marketplacepos 5.43.12 → 5.43.13
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-64X37DDM.js → chunk-2GSWEJRP.js} +1 -1
- package/Marketplace/{chunk-UJJ37NMF.js → chunk-2OVYEC6Q.js} +1 -1
- package/Marketplace/{chunk-W2XLHQKX.js → chunk-2TRFYYCP.js} +1 -1
- package/Marketplace/{chunk-5WIVVYBR.js → chunk-2YFZS6SG.js} +1 -1
- package/Marketplace/{chunk-CWFVKONJ.js → chunk-3TDK2RMH.js} +1 -1
- package/Marketplace/{chunk-U6YLKCIN.js → chunk-4B4NNOKK.js} +1 -1
- package/Marketplace/{chunk-MLO6RETZ.js → chunk-56IX4GTG.js} +1 -1
- package/Marketplace/{chunk-ZFUMZWQD.js → chunk-624I4PEE.js} +1 -1
- package/Marketplace/{chunk-T5TPUUPB.js → chunk-6BAZYVHI.js} +2 -2
- package/Marketplace/{chunk-RRNK7AYL.js → chunk-6G5WVJGA.js} +1 -1
- package/Marketplace/{chunk-OLIX5W4T.js → chunk-6NHTTVBK.js} +1 -1
- package/Marketplace/{chunk-CKY4W4YX.js → chunk-AG2REZBE.js} +1 -1
- package/Marketplace/{chunk-AJI575A3.js → chunk-AJJSLBE3.js} +2 -2
- package/Marketplace/{chunk-5GH7ALQK.js → chunk-ALSCWTAY.js} +1 -1
- package/Marketplace/{chunk-2CKKNRWY.js → chunk-C3HL4S2R.js} +1 -1
- package/Marketplace/{chunk-XRDYBOEK.js → chunk-CUEO37N7.js} +1 -1
- package/Marketplace/{chunk-LMGGSU22.js → chunk-E6U3KRK7.js} +1 -1
- package/Marketplace/{chunk-5MPVI3PN.js → chunk-G2CMMGM2.js} +1 -1
- package/Marketplace/{chunk-L4L5OQAC.js → chunk-GMVNN57A.js} +1 -1
- package/Marketplace/{chunk-YDEJA4O7.js → chunk-GVL2YXE5.js} +1 -1
- package/Marketplace/{chunk-F7RHAUNW.js → chunk-HLOBDI4F.js} +1 -1
- package/Marketplace/{chunk-EH2R354T.js → chunk-IRLIWSK5.js} +1 -1
- package/Marketplace/{chunk-CJWADFNA.js → chunk-J7AN3ZQL.js} +1 -1
- package/Marketplace/{chunk-ZIYN2SNO.js → chunk-LOBNKJGT.js} +1 -1
- package/Marketplace/{chunk-JAU5KJNP.js → chunk-LROLRGKE.js} +1 -1
- package/Marketplace/{chunk-3ZYAWDIE.js → chunk-MMVLDCF6.js} +1 -1
- package/Marketplace/{chunk-6ROQP3RC.js → chunk-MY5ZX6JG.js} +1 -1
- package/Marketplace/{chunk-PMNZKH6Y.js → chunk-N3P55TG2.js} +1 -1
- package/Marketplace/{chunk-F7GJCFHO.js → chunk-NEYMDA6P.js} +1 -1
- package/Marketplace/{chunk-YEPIRHVM.js → chunk-OLCFJJOD.js} +1 -1
- package/Marketplace/{chunk-4DKXEPDD.js → chunk-OOCYP2XG.js} +1 -1
- package/Marketplace/{chunk-Q4V5TFDG.js → chunk-POR3OF22.js} +1 -1
- package/Marketplace/{chunk-2KUNLKEI.js → chunk-PXYBLGMN.js} +1 -1
- package/Marketplace/{chunk-3YQVLE5W.js → chunk-Q3MVAL6O.js} +1 -1
- package/Marketplace/{chunk-MFJR5HMS.js → chunk-QQXVBN22.js} +1 -1
- package/Marketplace/{chunk-U6ARDOJI.js → chunk-SMUCMLEE.js} +1 -1
- package/Marketplace/{chunk-PJ5QMIC2.js → chunk-TCS2Y6CC.js} +1 -1
- package/Marketplace/{chunk-EH553VTO.js → chunk-U7TVLBC5.js} +1 -1
- package/Marketplace/{chunk-YGEKAO5R.js → chunk-UG7VRDLB.js} +1 -1
- package/Marketplace/{chunk-55RGFLHB.js → chunk-V2RVHNCX.js} +1 -1
- package/Marketplace/{chunk-A5VA3CHW.js → chunk-WHG5PPSE.js} +1 -1
- package/Marketplace/{chunk-TE2KRPDL.js → chunk-WS4A4RPE.js} +1 -1
- package/Marketplace/{chunk-5ZAFPJZ4.js → chunk-YD5TUVFF.js} +1 -1
- package/Marketplace/{chunk-RBLKTSAZ.js → chunk-ZWBTWIGY.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-FEG3OGSE.js → main-2SUNMEPM.js} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-QWHPQWPM.js";import"./chunk-RZU7PSKG.js";import"./chunk-MS4AQ6UA.js";import{a as Ge}from"./chunk-
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=h(te);_elementRef=h(ie);_ariaDescriber=h($e);_renderer=h(oe);_animationMode=h(ne,{optional:!0});_idGenerator=h(Ue);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Re);_document=h(ge);constructor(){let t=h(Le);t.load(ot),t.load(Be)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(Ze),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=re({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&k("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ve,J,J]})}return e})();function lt(e,a){if(e&1&&(z(0),r(1,"p",25),p(2),s(),N()),e&2){let t=m(3).$implicit;l(2),T(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function dt(e,a){if(e&1&&(r(0,"a",24),C(1,"i"),f(2,lt,3,1,"ng-container",22)(3,st,2,1,"ng-template",null,1,L),s()),e&2){let t=A(4),i=m(2).$implicit;c("href",i.Url,ae),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ct(e,a){if(e&1&&(z(0),f(1,dt,5,5,"a",23),N()),e&2){let t=m().$implicit;l(),c("ngxPermissionsOnly",t.Roles)}}function mt(e,a){if(e&1&&(r(0,"p",25),p(1),s()),e&2){let t=m(4).$implicit;l(),T(" ",t.Title," ")}}function pt(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(4).$implicit;l(),M(t.Title)}}function gt(e,a){if(e&1&&(z(0),f(1,mt,2,1,"p",25),H(2,"async"),f(3,pt,2,1,"p"),N()),e&2){let t=m(4);l(),se(W(2,1,t.notifications$)!=0?1:3)}}function ht(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function ft(e,a){if(e&1&&(r(0,"a",27),C(1,"i"),f(2,gt,4,3,"ng-container",22)(3,ht,2,1,"ng-template",null,2,L),s()),e&2){let t=A(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ut(e,a){if(e&1&&f(0,ft,5,6,"a",26),e&2){let t=m().$implicit;c("ngxPermissionsOnly",t.Roles)}}function _t(e,a){if(e&1&&(r(0,"li",21),f(1,ct,2,1,"ng-container",22)(2,ut,1,1,"ng-template",null,0,L),s()),e&2){let t=a.$implicit,i=A(3);l(),c("ngIf",t.ExternalLink)("ngIfElse",i)}}var et=(()=>{class e{constructor(t,i,n,d){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=d,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new $().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(D(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(I(Ne),I(Ae),I(we),I(Pe))}}static{this.\u0275cmp=v({type:e,selectors:[["app-menu"]],standalone:!1,decls:28,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(r(0,"div",3),H(1,"async"),r(2,"div",4)(3,"button",5),w("click",function(){return n.onCallapseSidebar()}),C(4,"i",6),s(),r(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),r(9,"div",10)(10,"div",11),p(11),s(),C(12,"div",12),r(13,"a",13),C(14,"i",14),p(15,"\xA0 "),r(16,"span"),p(17,"My Profile"),s()(),r(18,"a",15),w("click",function(){return n.onLogout()}),C(19,"i",16),p(20,"\xA0 "),r(21,"span"),p(22," Log Out"),s()()()()(),r(23,"div",17)(24,"ul",18),f(25,_t,4,2,"li",19),s()()(),r(26,"div",20),C(27,"router-outlet"),s()()),i&2&&(k("nav-open",W(1,7,n.toggleState$)),l(2),c("ngClass",n.isCollapseSidebar?"collapses":""),l(2),c("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),l(4),T(" ",n.storeName," "),l(3),T(" ",n.token==null?null:n.token.LID," "),l(14),c("ngForOf",n.Menu))},dependencies:[he,fe,ue,Ce,Me,ye,Fe,Ke,Oe,_e],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var u=(e,a)=>F(null,null,function*(){let t=h(Te),i=h(ve),n=e.data?.roles||[],d=e.data?.redirectUrl||"/";return n.length===0||(yield bt(t,n))?!0:(i.navigate([d]),!1)});function bt(e,a){return F(this,null,function*(){let t=a.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ct=[{path:"",component:et,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-GH57P6KF.js").then(e=>e.routes),canActivate:[g],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-67N4UGA5.js").then(e=>e.DashboardModule),canActivate:[g,u,Ge],data:{title:"Dashboard",roles:[o.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-5GH7ALQK.js").then(e=>e.ProductModule),canActivate:[g,u],data:{title:"Products",roles:[o.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-CJWADFNA.js").then(e=>e.InventoryRoutingModule),canActivate:[g,u],data:{title:"Inventory",roles:[o.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-CWFVKONJ.js").then(e=>e.PriceRoutingModule),canActivate:[g,u],data:{title:"Price",roles:[o.PriceView],redirectUrl:"/menu/Order"}},{path:"Order",loadChildren:()=>import("./chunk-T5TPUUPB.js").then(e=>e.OrdersModule),canActivate:[g,u],data:{title:"Order",roles:[o.OrderView],redirectUrl:"/menu/sync-log"}},{path:"orderV2",loadChildren:()=>import("./chunk-2KUNLKEI.js").then(e=>e.routes),canActivate:[g],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-PMNZKH6Y.js").then(e=>e.ReportModule),canActivate:[g,u],data:{title:"Report",roles:[o.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-YEPIRHVM.js").then(e=>e.LogisticModule),canActivate:[g,u],data:{title:"Logistic",roles:[o.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-CKY4W4YX.js").then(e=>e.ChannelsModule),canActivate:[g,u],data:{title:"Marketplace",roles:[o.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-PJ5QMIC2.js").then(e=>e.LogsModule),canActivate:[g,u],data:{title:"Orders",roles:[o.DevView]}},{path:"users",loadChildren:()=>import("./chunk-I7FTVK26.js").then(e=>e.userRoutes),canActivate:[g,u],data:{title:"Users",roles:[o.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-MFJR5HMS.js").then(e=>e.routes),canActivate:[g],data:{title:"Json API"}}]}],tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[q.forChild(Ct),q]})}}return e})();var Mt=["selectId"];function yt(e,a){if(e&1&&(r(0,"span",3),p(1),s()),e&2){let t=a.item,i=m();c("title",t[i.bindLabel]),l(),M(t[i.bindLabel])}}var it=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Y,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&ce(Mt,7),i&2){let d;me(d=pe())&&(n.ngSelectElement=d.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let d=de();r(0,"ng-select",1,0),w("clear",function(){return x(d),S(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return x(d),S(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return x(d),S(n.onOpenSelect())})("change",function(at){return x(d),S(n.onSelectChange(at))}),f(2,yt,2,2,"ng-template",2),s()}i&2&&(le("width",n.width),c("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[y,V,ze,ke,R,xe,Se],encapsulation:2})}}return e})(),Y=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new j,this._destroy$=new j,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(K(200),X(),D(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Z(a=>a!==void 0),ee(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(d=>(i=JSON.stringify(d).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(De.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var nt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[y,R,je,qe,Qe,We,Je,Ye,U,Q,it,V,Ie]})}}return e})();var un=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({providers:[be],imports:[y,tt,He,U,nt,Xe,Ee.forChild()]})}}return e})();export{un as MenuModule};
|
|
1
|
+
import"./chunk-QWHPQWPM.js";import"./chunk-RZU7PSKG.js";import"./chunk-MS4AQ6UA.js";import{a as Ge}from"./chunk-2YFZS6SG.js";import"./chunk-PE5AFID4.js";import{c as qe}from"./chunk-MHCAI6KP.js";import{b as Je}from"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-3NMM37H7.js";import{b as Ye}from"./chunk-BFU7VKO3.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{b as Qe}from"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import{a as g}from"./chunk-G2CMMGM2.js";import"./chunk-3RK6DDJD.js";import{a as We}from"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as o}from"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{h as Pe}from"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import{a as De}from"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as ke,d as ze,e as V}from"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import{a as Te,b as Oe,c as Ee}from"./chunk-SWQXSJ7O.js";import{a as Ae}from"./chunk-DRMAONR7.js";import{a as we}from"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{a as Ne,h as je,k as Q,n as He}from"./chunk-CLER2MX6.js";import{A as R,B as Ie,h as xe,m as Se}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Fe,s as U}from"./chunk-YCH6HHU3.js";import{B as $e,M as J,m as Le,n as Be,q as Re,u as Ve,v as Ue}from"./chunk-B73M3AMU.js";import{F as Ce,G as ve,H as Me,I as ye,J as q,a as ge,d as he,f as fe,g as ue,j as _e,k as be,n as y}from"./chunk-M2FCTYGU.js";import{$c as H,Ac as ce,Bc as me,Cc as pe,Fc as A,G as Z,Gb as v,Gc as p,Hb as b,Hc as M,Ib as re,Ic as T,Ka as P,La as te,M as K,Mb as f,Pa as ie,Q as X,Xa as ne,Yb as c,Zb as le,_b as k,ac as G,ad as W,ca as ee,cd as L,dc as se,f as j,ic as r,jc as s,ka as _,kc as C,lc as z,mc as N,oc as de,od as B,pa as h,pb as ae,rb as l,tc as w,uc as m,v as D,wb as oe,xb as I,ya as x,za as S}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{i as F}from"./chunk-66YHNWRR.js";var $=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[o.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[o.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[o.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[o.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/orderV2",Roles:[o.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[o.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[o.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[o.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[o.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[o.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[o.JsonApiView]}]}get getMenu(){return this.menus}};var Ze="mat-badge-content",ot=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=v({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=h(te);_elementRef=h(ie);_ariaDescriber=h($e);_renderer=h(oe);_animationMode=h(ne,{optional:!0});_idGenerator=h(Ue);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Re);_document=h(ge);constructor(){let t=h(Le);t.load(ot),t.load(Be)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(Ze),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=re({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&k("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ve,J,J]})}return e})();function lt(e,a){if(e&1&&(z(0),r(1,"p",25),p(2),s(),N()),e&2){let t=m(3).$implicit;l(2),T(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function dt(e,a){if(e&1&&(r(0,"a",24),C(1,"i"),f(2,lt,3,1,"ng-container",22)(3,st,2,1,"ng-template",null,1,L),s()),e&2){let t=A(4),i=m(2).$implicit;c("href",i.Url,ae),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ct(e,a){if(e&1&&(z(0),f(1,dt,5,5,"a",23),N()),e&2){let t=m().$implicit;l(),c("ngxPermissionsOnly",t.Roles)}}function mt(e,a){if(e&1&&(r(0,"p",25),p(1),s()),e&2){let t=m(4).$implicit;l(),T(" ",t.Title," ")}}function pt(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(4).$implicit;l(),M(t.Title)}}function gt(e,a){if(e&1&&(z(0),f(1,mt,2,1,"p",25),H(2,"async"),f(3,pt,2,1,"p"),N()),e&2){let t=m(4);l(),se(W(2,1,t.notifications$)!=0?1:3)}}function ht(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function ft(e,a){if(e&1&&(r(0,"a",27),C(1,"i"),f(2,gt,4,3,"ng-container",22)(3,ht,2,1,"ng-template",null,2,L),s()),e&2){let t=A(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ut(e,a){if(e&1&&f(0,ft,5,6,"a",26),e&2){let t=m().$implicit;c("ngxPermissionsOnly",t.Roles)}}function _t(e,a){if(e&1&&(r(0,"li",21),f(1,ct,2,1,"ng-container",22)(2,ut,1,1,"ng-template",null,0,L),s()),e&2){let t=a.$implicit,i=A(3);l(),c("ngIf",t.ExternalLink)("ngIfElse",i)}}var et=(()=>{class e{constructor(t,i,n,d){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=d,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new $().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(D(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(I(Ne),I(Ae),I(we),I(Pe))}}static{this.\u0275cmp=v({type:e,selectors:[["app-menu"]],standalone:!1,decls:28,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(r(0,"div",3),H(1,"async"),r(2,"div",4)(3,"button",5),w("click",function(){return n.onCallapseSidebar()}),C(4,"i",6),s(),r(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),r(9,"div",10)(10,"div",11),p(11),s(),C(12,"div",12),r(13,"a",13),C(14,"i",14),p(15,"\xA0 "),r(16,"span"),p(17,"My Profile"),s()(),r(18,"a",15),w("click",function(){return n.onLogout()}),C(19,"i",16),p(20,"\xA0 "),r(21,"span"),p(22," Log Out"),s()()()()(),r(23,"div",17)(24,"ul",18),f(25,_t,4,2,"li",19),s()()(),r(26,"div",20),C(27,"router-outlet"),s()()),i&2&&(k("nav-open",W(1,7,n.toggleState$)),l(2),c("ngClass",n.isCollapseSidebar?"collapses":""),l(2),c("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),l(4),T(" ",n.storeName," "),l(3),T(" ",n.token==null?null:n.token.LID," "),l(14),c("ngForOf",n.Menu))},dependencies:[he,fe,ue,Ce,Me,ye,Fe,Ke,Oe,_e],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var u=(e,a)=>F(null,null,function*(){let t=h(Te),i=h(ve),n=e.data?.roles||[],d=e.data?.redirectUrl||"/";return n.length===0||(yield bt(t,n))?!0:(i.navigate([d]),!1)});function bt(e,a){return F(this,null,function*(){let t=a.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ct=[{path:"",component:et,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-GH57P6KF.js").then(e=>e.routes),canActivate:[g],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-67N4UGA5.js").then(e=>e.DashboardModule),canActivate:[g,u,Ge],data:{title:"Dashboard",roles:[o.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-ALSCWTAY.js").then(e=>e.ProductModule),canActivate:[g,u],data:{title:"Products",roles:[o.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-J7AN3ZQL.js").then(e=>e.InventoryRoutingModule),canActivate:[g,u],data:{title:"Inventory",roles:[o.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-3TDK2RMH.js").then(e=>e.PriceRoutingModule),canActivate:[g,u],data:{title:"Price",roles:[o.PriceView],redirectUrl:"/menu/Order"}},{path:"Order",loadChildren:()=>import("./chunk-6BAZYVHI.js").then(e=>e.OrdersModule),canActivate:[g,u],data:{title:"Order",roles:[o.OrderView],redirectUrl:"/menu/sync-log"}},{path:"orderV2",loadChildren:()=>import("./chunk-PXYBLGMN.js").then(e=>e.routes),canActivate:[g],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-N3P55TG2.js").then(e=>e.ReportModule),canActivate:[g,u],data:{title:"Report",roles:[o.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-OLCFJJOD.js").then(e=>e.LogisticModule),canActivate:[g,u],data:{title:"Logistic",roles:[o.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-AG2REZBE.js").then(e=>e.ChannelsModule),canActivate:[g,u],data:{title:"Marketplace",roles:[o.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-TCS2Y6CC.js").then(e=>e.LogsModule),canActivate:[g,u],data:{title:"Orders",roles:[o.DevView]}},{path:"users",loadChildren:()=>import("./chunk-I7FTVK26.js").then(e=>e.userRoutes),canActivate:[g,u],data:{title:"Users",roles:[o.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-QQXVBN22.js").then(e=>e.routes),canActivate:[g],data:{title:"Json API"}}]}],tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[q.forChild(Ct),q]})}}return e})();var Mt=["selectId"];function yt(e,a){if(e&1&&(r(0,"span",3),p(1),s()),e&2){let t=a.item,i=m();c("title",t[i.bindLabel]),l(),M(t[i.bindLabel])}}var it=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Y,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&ce(Mt,7),i&2){let d;me(d=pe())&&(n.ngSelectElement=d.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let d=de();r(0,"ng-select",1,0),w("clear",function(){return x(d),S(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return x(d),S(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return x(d),S(n.onOpenSelect())})("change",function(at){return x(d),S(n.onSelectChange(at))}),f(2,yt,2,2,"ng-template",2),s()}i&2&&(le("width",n.width),c("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[y,V,ze,ke,R,xe,Se],encapsulation:2})}}return e})(),Y=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new j,this._destroy$=new j,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(K(200),X(),D(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Z(a=>a!==void 0),ee(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(d=>(i=JSON.stringify(d).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(De.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var nt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[y,R,je,qe,Qe,We,Je,Ye,U,Q,it,V,Ie]})}}return e})();var un=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({providers:[be],imports:[y,tt,He,U,nt,Xe,Ee.forChild()]})}}return e})();export{un as MenuModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-AJL3CYNX.js";import{a as h}from"./chunk-2EOAYJGX.js";import{a as m}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-AJL3CYNX.js";import{a as h}from"./chunk-2EOAYJGX.js";import{a as m}from"./chunk-2YFZS6SG.js";import"./chunk-PE5AFID4.js";import{c as M}from"./chunk-MHCAI6KP.js";import{b as O}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import{a as P}from"./chunk-3B2PNJWF.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import{a}from"./chunk-G2CMMGM2.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{a as C}from"./chunk-WPW3D4MQ.js";import"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{e as g}from"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{n as f}from"./chunk-CLER2MX6.js";import{A as u}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{s}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as l,J as i,n as r}from"./chunk-M2FCTYGU.js";import{Gb as d,Hb as e,ka as n,kc as c}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=d({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,v){o&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-Q3MVAL6O.js").then(t=>t.StatusModule),canActivate:[a,m]},{path:"download",loadChildren:()=>import("./chunk-WS4A4RPE.js").then(t=>t.DownloadModule),canActivate:[a,m]},{path:"upload",loadComponent:()=>import("./chunk-E6U3KRK7.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a,m]}]}],w=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(y)]})}}return t})();var X=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,u,i,w,s,f,g,O,C,M,P,h,b]})}}return t})();export{X as ProductModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ie,b as qe}from"./chunk-YZKPQRLO.js";import{a as Ue,b as Ge,c as je,e as Ke,f as He,g as Qe}from"./chunk-6W6DKFRE.js";import{e as We,k as Le,l as Ae,m as $e,n as ze,o as Ye}from"./chunk-M5JQ7BGW.js";import"./chunk-7UHCDGAA.js";import{a as Oe,b as Ne,c as Re}from"./chunk-MHCAI6KP.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as Be}from"./chunk-ZIYN2SNO.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-WW22F76D.js";import"./chunk-B5VBBEEN.js";import"./chunk-E3ROEHBW.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-7SVF5UPT.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{g as be,h as ee}from"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as Z}from"./chunk-5HO2IJ47.js";import{c as Ee,d as Pe,e as Ie}from"./chunk-5JVEEL2T.js";import{b as X,c as y}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as De,e as Te}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Fe,n as ke}from"./chunk-CLER2MX6.js";import{A as xe,c as Se,h as Ce,m as ve,x as ye}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Me,s as Ve}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{J as we,d as W,f as B,g as L,j as q,k as J,n as F}from"./chunk-M2FCTYGU.js";import{$c as R,Ac as ce,Bc as he,Cc as ue,Fc as T,Gb as I,Gc as s,Hc as V,Ic as C,Ka as j,Kc as b,Lc as E,Mb as g,Mc as P,Oa as k,Qc as K,Ra as _,Sc as fe,Tc as _e,Yb as d,Z as z,aa as le,ad as U,bd as ge,cd as H,dc as M,ea as Y,ic as o,ja as se,jc as a,kc as S,lc as O,m as re,mc as N,oc as x,pa as v,pb as pe,rb as r,sd as Q,tc as w,uc as h,v as G,xc as de,ya as m,yc as me,za as c}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as ae,b as oe}from"./chunk-66YHNWRR.js";var et=t=>({"over-due":t});function tt(t,p){if(t&1&&(o(0,"tr",8)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),t&2){let e=p.$implicit,n=p.index;d("ngClass",fe(5,et,e.Exception)),r(2),V(n+1),r(2),V(e.Number),r(2),V(e.Status),r(2),V(e.Exception)}}function it(t,p){if(t&1&&(O(0),g(1,tt,9,7,"tr",7),N()),t&2){let e,n=h();r(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function nt(t,p){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),a(),o(4,"h4",13),s(5," There is no order to processed "),a()()())}var Je=(()=>{class t{constructor(){this.downloadResult=k()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),g(13,it,2,1,"ng-container",6)(14,nt,6,0,"ng-template",null,0,H),a()()()()),n&2){let l,u=T(15);r(13),d("ngIf",((l=i.downloadResult())==null||l.Body==null?null:l.Body.length)>0)("ngIfElse",u)}},dependencies:[F,W,B,L],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(Te),this.toastr=v(De),this.datePipe=v(J)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(Y(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):re}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),l=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${l} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?y.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):y.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=y.formatTitleFromDate(new Date(e),new Date(n)),l=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":l+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=se({token:t,factory:t.\u0275fac})}}return t})();function at(t,p){if(t&1&&(o(0,"ng-option",13),S(1,"img",14),s(2),a()),t&2){let e=p.$implicit;d("value",e.ID),r(),d("src",e==null?null:e.Img,pe),r(),C("",e.Name," ")}}function ot(t,p){if(t&1){let e=x();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),P("ngModelChange",function(i){m(e);let l=h();return E(l.downloadType,i)||(l.downloadType=i),c(i)}),w("ngModelChange",function(){m(e);let i=h();return c(i.onDownloadTypeChange())}),o(10,"mat-radio-button",17),s(11," Orders "),a(),o(12,"mat-radio-button",18),s(13," Disbursement "),a()()()(),o(14,"div",19)(15,"div",20),S(16,"i",21),a(),o(17,"p",22),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=h();r(9),b("ngModel",e.downloadType),r(),d("value",!1),r(2),d("value",!0)}}function rt(t,p){t&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",23),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function lt(t,p){t&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function st(t,p){if(t&1){let e=x();o(0,"div",12)(1,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.startTime,i)||(l.startTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onStartTimeChange())}),a(),o(2,"span",25),s(3,"-"),a(),o(4,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.endTime,i)||(l.endTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onEndTimeChange())}),a()()}if(t&2){let e=h();r(),b("time",e.startTime),r(3),b("time",e.endTime)}}var Xe=(()=>{class t{constructor(){this.reset=k(!1),this.authService=v(ee),this.tokenService=v(be),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.minDate=_(new Date),this.maxDate=_(new Date),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,l=y.addDays(i,n-1);this.minDate.set(l)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(G(e=>e?.Model),z(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=y.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A,We()])],decls:27,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let l=x();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(f){return m(l),E(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),w("ngModelChange",function(){return m(l),c(i.onSelectChannel())}),g(10,at,3,3,"ng-option",7),a()()(),g(11,ot,19,3,"div",8),R(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),s(16,"Date Range"),a(),g(17,rt,5,0,"p",5)(18,lt,2,0,"p",5),a(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),P("ngModelChange",function(f){return m(l),E(i.startDate,f)||(i.startDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())}),a(),o(23,"input",11),P("ngModelChange",function(f){return m(l),E(i.endDate,f)||(i.endDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(l),c(i.onFilterDateChange())}),a()(),S(24,"mat-date-range-picker",null,0),a(),g(26,st,5,2,"div",12),a()()()()}if(n&2){let l,u,f=T(25);r(9),d("clearable",!1),b("ngModel",i.selectedChannelId),r(),d("ngForOf",i.channelOptions()),r(),M((l=U(12,11,i.channelDetail$))!=null&&l.ServiceFeeWriteOff&&((l=i.selectedChannel())==null?null:l.TypeID)==i.channelType.Tokopedia?11:-1),r(6),M(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),r(4),d("rangePicker",f)("min",i.minDate())("max",i.maxDate()),r(),b("ngModel",i.startDate),r(),b("ngModel",i.endDate),r(3),M(i.showTimePicker()?26:-1)}},dependencies:[F,B,q,Ie,Pe,Ee,Re,Oe,Ne,xe,Se,Ce,ye,ve,qe,ze,Le,Ye,Ae,$e],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var $=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}($||{});var pt=(t,p)=>({"over-due-today":t,"over-due":p});function dt(t,p){if(t&1&&(o(0,"th",21),s(1),a()),t&2){let e=h();r(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function mt(t,p){if(t&1&&(o(0,"td"),s(1),R(2,"date"),a()),t&2){let e=h().$implicit;r(),C(" ",ge(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function ct(t,p){if(t&1&&(o(0,"span"),s(1),a()),t&2){let e=h().$implicit;r(),C(" ",e.ActionString," ")}}function ht(t,p){if(t&1&&(o(0,"li"),s(1),a()),t&2){let e=p.$implicit;r(),C(" ",e," ")}}function ut(t,p){if(t&1&&(o(0,"ul",27),g(1,ht,2,1,"li",22),a()),t&2){let e=h().$implicit;r(),d("ngForOf",e.ActionString)}}function ft(t,p){if(t&1&&(o(0,"span",28),S(1,"i",29),a()),t&2){let e=h().$implicit;me("title","Delivery : ",e.DeliveryState,`
|
|
1
|
+
import{a as ie,b as qe}from"./chunk-YZKPQRLO.js";import{a as Ue,b as Ge,c as je,e as Ke,f as He,g as Qe}from"./chunk-6W6DKFRE.js";import{e as We,k as Le,l as Ae,m as $e,n as ze,o as Ye}from"./chunk-M5JQ7BGW.js";import"./chunk-7UHCDGAA.js";import{a as Oe,b as Ne,c as Re}from"./chunk-MHCAI6KP.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as Be}from"./chunk-LOBNKJGT.js";import"./chunk-AQTXFEBA.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-WW22F76D.js";import"./chunk-B5VBBEEN.js";import"./chunk-E3ROEHBW.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-7SVF5UPT.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{g as be,h as ee}from"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as Z}from"./chunk-5HO2IJ47.js";import{c as Ee,d as Pe,e as Ie}from"./chunk-5JVEEL2T.js";import{b as X,c as y}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as De,e as Te}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Fe,n as ke}from"./chunk-CLER2MX6.js";import{A as xe,c as Se,h as Ce,m as ve,x as ye}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Me,s as Ve}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{J as we,d as W,f as B,g as L,j as q,k as J,n as F}from"./chunk-M2FCTYGU.js";import{$c as R,Ac as ce,Bc as he,Cc as ue,Fc as T,Gb as I,Gc as s,Hc as V,Ic as C,Ka as j,Kc as b,Lc as E,Mb as g,Mc as P,Oa as k,Qc as K,Ra as _,Sc as fe,Tc as _e,Yb as d,Z as z,aa as le,ad as U,bd as ge,cd as H,dc as M,ea as Y,ic as o,ja as se,jc as a,kc as S,lc as O,m as re,mc as N,oc as x,pa as v,pb as pe,rb as r,sd as Q,tc as w,uc as h,v as G,xc as de,ya as m,yc as me,za as c}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as ae,b as oe}from"./chunk-66YHNWRR.js";var et=t=>({"over-due":t});function tt(t,p){if(t&1&&(o(0,"tr",8)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),t&2){let e=p.$implicit,n=p.index;d("ngClass",fe(5,et,e.Exception)),r(2),V(n+1),r(2),V(e.Number),r(2),V(e.Status),r(2),V(e.Exception)}}function it(t,p){if(t&1&&(O(0),g(1,tt,9,7,"tr",7),N()),t&2){let e,n=h();r(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function nt(t,p){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),a(),o(4,"h4",13),s(5," There is no order to processed "),a()()())}var Je=(()=>{class t{constructor(){this.downloadResult=k()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),g(13,it,2,1,"ng-container",6)(14,nt,6,0,"ng-template",null,0,H),a()()()()),n&2){let l,u=T(15);r(13),d("ngIf",((l=i.downloadResult())==null||l.Body==null?null:l.Body.length)>0)("ngIfElse",u)}},dependencies:[F,W,B,L],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(Te),this.toastr=v(De),this.datePipe=v(J)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(Y(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):re}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),l=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${l} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?y.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):y.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=y.formatTitleFromDate(new Date(e),new Date(n)),l=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":l+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=se({token:t,factory:t.\u0275fac})}}return t})();function at(t,p){if(t&1&&(o(0,"ng-option",13),S(1,"img",14),s(2),a()),t&2){let e=p.$implicit;d("value",e.ID),r(),d("src",e==null?null:e.Img,pe),r(),C("",e.Name," ")}}function ot(t,p){if(t&1){let e=x();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),P("ngModelChange",function(i){m(e);let l=h();return E(l.downloadType,i)||(l.downloadType=i),c(i)}),w("ngModelChange",function(){m(e);let i=h();return c(i.onDownloadTypeChange())}),o(10,"mat-radio-button",17),s(11," Orders "),a(),o(12,"mat-radio-button",18),s(13," Disbursement "),a()()()(),o(14,"div",19)(15,"div",20),S(16,"i",21),a(),o(17,"p",22),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=h();r(9),b("ngModel",e.downloadType),r(),d("value",!1),r(2),d("value",!0)}}function rt(t,p){t&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",23),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function lt(t,p){t&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function st(t,p){if(t&1){let e=x();o(0,"div",12)(1,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.startTime,i)||(l.startTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onStartTimeChange())}),a(),o(2,"span",25),s(3,"-"),a(),o(4,"app-timepicker",24),P("timeChange",function(i){m(e);let l=h();return E(l.endTime,i)||(l.endTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onEndTimeChange())}),a()()}if(t&2){let e=h();r(),b("time",e.startTime),r(3),b("time",e.endTime)}}var Xe=(()=>{class t{constructor(){this.reset=k(!1),this.authService=v(ee),this.tokenService=v(be),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.minDate=_(new Date),this.maxDate=_(new Date),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,l=y.addDays(i,n-1);this.minDate.set(l)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(G(e=>e?.Model),z(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=y.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A,We()])],decls:27,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let l=x();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(f){return m(l),E(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),w("ngModelChange",function(){return m(l),c(i.onSelectChannel())}),g(10,at,3,3,"ng-option",7),a()()(),g(11,ot,19,3,"div",8),R(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),s(16,"Date Range"),a(),g(17,rt,5,0,"p",5)(18,lt,2,0,"p",5),a(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),P("ngModelChange",function(f){return m(l),E(i.startDate,f)||(i.startDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())}),a(),o(23,"input",11),P("ngModelChange",function(f){return m(l),E(i.endDate,f)||(i.endDate=f),c(f)}),w("click",function(){m(l);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(l),c(i.onFilterDateChange())}),a()(),S(24,"mat-date-range-picker",null,0),a(),g(26,st,5,2,"div",12),a()()()()}if(n&2){let l,u,f=T(25);r(9),d("clearable",!1),b("ngModel",i.selectedChannelId),r(),d("ngForOf",i.channelOptions()),r(),M((l=U(12,11,i.channelDetail$))!=null&&l.ServiceFeeWriteOff&&((l=i.selectedChannel())==null?null:l.TypeID)==i.channelType.Tokopedia?11:-1),r(6),M(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),r(4),d("rangePicker",f)("min",i.minDate())("max",i.maxDate()),r(),b("ngModel",i.startDate),r(),b("ngModel",i.endDate),r(3),M(i.showTimePicker()?26:-1)}},dependencies:[F,B,q,Ie,Pe,Ee,Re,Oe,Ne,xe,Se,Ce,ye,ve,qe,ze,Le,Ye,Ae,$e],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var $=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}($||{});var pt=(t,p)=>({"over-due-today":t,"over-due":p});function dt(t,p){if(t&1&&(o(0,"th",21),s(1),a()),t&2){let e=h();r(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function mt(t,p){if(t&1&&(o(0,"td"),s(1),R(2,"date"),a()),t&2){let e=h().$implicit;r(),C(" ",ge(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function ct(t,p){if(t&1&&(o(0,"span"),s(1),a()),t&2){let e=h().$implicit;r(),C(" ",e.ActionString," ")}}function ht(t,p){if(t&1&&(o(0,"li"),s(1),a()),t&2){let e=p.$implicit;r(),C(" ",e," ")}}function ut(t,p){if(t&1&&(o(0,"ul",27),g(1,ht,2,1,"li",22),a()),t&2){let e=h().$implicit;r(),d("ngForOf",e.ActionString)}}function ft(t,p){if(t&1&&(o(0,"span",28),S(1,"i",29),a()),t&2){let e=h().$implicit;me("title","Delivery : ",e.DeliveryState,`
|
|
2
2
|
Payment : `,e.PaymentState,"")}}function _t(t,p){if(t&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),g(5,mt,3,4,"td",23),o(6,"td")(7,"span"),s(8),a(),s(9),a(),o(10,"td",24)(11,"span"),s(12),a(),s(13),a(),o(14,"td"),g(15,ct,2,1,"span",23)(16,ut,2,1,"ul",25),a(),o(17,"td"),g(18,ft,2,3,"span",26),a()()),t&2){let e,n=p.$implicit,i=p.index,l=h(2);r(2),V(i+1),r(2),V(n.Number),r(),d("ngIf",((e=l.selectedChannel())==null?null:e.TypeID)!=l.channelType.Shopee&&((e=l.selectedChannel())==null?null:e.TypeID)!==l.channelType.Tiktok),r(3),C("",n.ChannelStatus," - "),r(),C("",n.ChannelStatusDescription," "),r(),d("ngClass",_e(12,pt,(n==null?null:n.Action)==l.actionPreviewOrder.Update,(n==null?null:n.Action)==l.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),r(2),C("",n.POSStatus," - "),r(),C("",n.POSStatusDescription," "),r(2),d("ngIf",n.ActionString.length==1),r(),d("ngIf",n.ActionString.length>1),r(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function gt(t,p){if(t&1&&(O(0),g(1,_t,19,15,"tr",22),N()),t&2){let e=h();r(),d("ngForOf",e.displayPreviewData())}}function wt(t,p){t&1&&(o(0,"tr",30)(1,"td",31)(2,"div",32),S(3,"i",33),a(),o(4,"h4",34),s(5," There is no order to processed "),a()()())}var Ze=(()=>{class t{constructor(){this.orderPreview=k(),this.selectedChannel=k(),this.channelType=X,this.allData=_(0),this.syncData=_(0),this.wrongData=_(0),this.unsyncData=_(0),this.pillStatus=_(D.ALL),this.actionPreviewOrder=$,this.previewStatus=D,this.displayPreviewData=_([]),this.exportOrders=new j,Q(()=>{this.orderPreview()&&(this.filterPreviewData(D.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(D.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(D.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(D.UNSYNC).length)}filterDataByStatus(e){let n=[];switch(e){case D.ALL:n=this.orderPreview();break;case D.SYNC:n=this.orderPreview().filter(i=>i.Action==$.DoNothing);break;case D.WRONG:n=this.orderPreview().filter(i=>i.Action==$.Update);break;case D.UNSYNC:n=this.orderPreview().filter(i=>i.Action==$.New);break}return n}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let l=x();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.ALL))}),s(8),a()(),o(9,"li",8)(10,"button",9),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.SYNC))}),s(11),a()(),o(12,"li",8)(13,"button",10),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.WRONG))}),s(14),a()(),o(15,"li",8)(16,"button",11),w("click",function(){return m(l),c(i.filterPreviewData(i.previewStatus.UNSYNC))}),s(17),a()()()(),o(18,"div")(19,"button",12),w("click",function(){return m(l),c(i.onExportOrders())}),S(20,"i",13),o(21,"span"),s(22,"Export"),a()()()()(),o(23,"table",14)(24,"thead",15)(25,"tr"),S(26,"th",16),o(27,"th",17),s(28,"Number"),a(),g(29,dt,2,1,"th",18),o(30,"th",19),s(31,"Channel Status"),a(),o(32,"th",19),s(33,"POS Status"),a(),o(34,"th"),s(35,"Action"),a(),S(36,"th",16),a()(),o(37,"tbody"),g(38,gt,2,1,"ng-container",20)(39,wt,6,0,"ng-template",null,0,H),a()()()()}if(n&2){let l,u,f=T(40);r(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),r(),C(" All (",i.allData(),") "),r(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),r(),C(" Existing (",i.syncData(),") "),r(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),r(),C(" Wrong Status (",i.wrongData(),") "),r(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),r(),C(" Missing (",i.unsyncData(),") "),r(12),d("ngIf",((l=i.selectedChannel())==null?null:l.TypeID)!=i.channelType.Shopee&&((l=i.selectedChannel())==null?null:l.TypeID)!==i.channelType.Tiktok),r(9),d("ngIf",((u=i.displayPreviewData())==null?null:u.length)>0)("ngIfElse",f)}},dependencies:[F,W,B,L,J,Ve,Me],encapsulation:2})}}return t})();var St=["stepper"];function Ct(t,p){if(t&1){let e=x();o(0,"div",2)(1,"button",19),w("click",function(){m(e);let i=h();return c(i.onStepperBack())}),s(2," Back "),a(),o(3,"button",20),w("click",function(){m(e);let i=h();return c(i.onNextStep())}),s(4," Next "),a()()}if(t&2){let e=h();r(3),d("disabled",e.disabledNextFilter())}}function vt(t,p){if(t&1){let e=x();o(0,"button",21),w("click",function(){m(e);let i=h();return c(i.onNextStep())}),s(1," Next "),a()}if(t&2){let e=h();d("disabled",e.disabledNextFilter())}}function yt(t,p){if(t&1){let e=x();o(0,"button",22),w("click",function(){m(e);let i=h();return c(i.onNewDownload())}),S(1,"i",23),s(2," New "),a()}}function xt(t,p){t&1&&(S(0,"i",24),o(1,"span"),s(2,"Filter"),a())}function Dt(t,p){t&1&&(S(0,"i",25),o(1,"span"),s(2,"Preview"),a())}function Tt(t,p){if(t&1){let e=x();O(0),o(1,"preview-step",26),w("onExportOrders",function(){m(e);let i=h();return c(i.onExportOrders())}),a(),N()}if(t&2){let e=p.ngIf;r(),d("orderPreview",e)}}function bt(t,p){t&1&&(S(0,"i",27),o(1,"span"),s(2,"Finish"),a())}function Et(t,p){if(t&1&&(O(0),S(1,"complete-step",28),N()),t&2){let e=p.ngIf;r(),d("downloadResult",e)}}function Pt(t,p){t&1&&(o(0,"h6"),s(1,"1"),a())}function It(t,p){t&1&&(o(0,"h6"),s(1,"2"),a())}function Mt(t,p){t&1&&(o(0,"h6"),s(1,"3"),a())}var Ui=(()=>{class t{constructor(){this.downloadService=v(A),this.orderService=v(ie),this.productService=v(Be),this.authService=v(ee),this.stepperSelectedIndex=_(0),this.disabledNextFilter=_(!0),this.isResetFilter=_(!1),this.pageTitle=_("Download to POS"),this.cacheKey=_(y.GuidEMpty)}onFilterChange(e){this.filter=e,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>y.IsEmpty(this.filter?.channelId)||!y.isValidDate(this.filter.startDate)||!y.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};y.IsNotEmpty(this.filter.startTime)&&(e=oe(ae({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(Y(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),G(n=>n.Data),z(1))}onExportOrders(){let e={ID:this.filter.channelId,From:this.filter.startDate?this.filter.startDate:null,To:this.filter.endDate?this.filter.endDate:null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(e,n).subscribe()}onDownload(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(le(n=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),Y(()=>{this.onStepperNext()}),z(1))}setPageTitle(e){this.pageTitle.update(()=>`
|
|
3
3
|
${e} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
|
|
4
4
|
`)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!0),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&ce(St,5),n&2){let l;he(l=ue())&&(i.stepper=l.first)}},features:[K([A,ie,{provide:Ue,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:20,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","reset"],["state","preview",3,"editable","completed"],[4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"],[3,"downloadResult"]],template:function(n,i){if(n&1){let l=x();o(0,"mainpanel",1)(1,"actions"),g(2,Ct,5,1,"div",2)(3,vt,2,1,"button",3)(4,yt,3,0,"button",4),a(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),P("selectedIndexChange",function(f){return m(l),E(i.stepperSelectedIndex,f)||(i.stepperSelectedIndex=f),c(f)}),o(12,"mat-step",10),g(13,xt,3,0,"ng-template",11),o(14,"filter-step",12),w("onFilterChange",function(f){return m(l),c(i.onFilterChange(f))}),a()(),o(15,"mat-step",13),g(16,Dt,3,0,"ng-template",11)(17,Tt,2,1,"ng-container",14),R(18,"async"),a(),o(19,"mat-step",15),g(20,bt,3,0,"ng-template",11)(21,Et,2,1,"ng-container",14),R(22,"async"),a(),g(23,Pt,2,0,"ng-template",16)(24,It,2,0,"ng-template",17)(25,Mt,2,0,"ng-template",18),a()()()()()()()}if(n&2){let l=T(11);d("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),r(2),M(i.stepperSelectedIndex()==1?2:-1),r(),M(i.stepperSelectedIndex()==0?3:-1),r(),M(i.stepperSelectedIndex()==2?4:-1),r(6),de("ngClass","last-edited-step-"+l.selectedIndex),b("selectedIndex",i.stepperSelectedIndex),r(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),r(2),d("reset",i.isResetFilter()),r(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),r(2),d("ngIf",U(18,16,i.orderPreview$)),r(4),d("ngIf",U(22,18,i.downloadPreview$))}},dependencies:[F,W,L,q,Je,Xe,Ze,Qe,Ke,Ge,He,je,ke,Fe,we],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-L64EL5OU.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-5BSS4CVK.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import{a as ve}from"./chunk-ZIYN2SNO.js";import"./chunk-M5XGP4SG.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-L64EL5OU.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-5BSS4CVK.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import{a as ve}from"./chunk-LOBNKJGT.js";import"./chunk-M5XGP4SG.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as Ft}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as St}from"./chunk-O5LFGGB2.js";import{a as be,b as ut,c as _t,d as ye,e as ve}from"./chunk-W2XLHQKX.js";import{a as st,b as he,c as mt,d as ge,f as gt,g as Ct,h as Te,i as bt,o as re}from"./chunk-M5JQ7BGW.js";import{b as vt}from"./chunk-7UHCDGAA.js";import{a as ft}from"./chunk-3B2PNJWF.js";import"./chunk-JDIBETL5.js";import{b as ht,d as xe}from"./chunk-L7K5HOBY.js";import{a as Tt,b as It}from"./chunk-BFU7VKO3.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{b as xt}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-ZIYN2SNO.js";import{a as yt}from"./chunk-M5XGP4SG.js";import{a as dt,b as Ce}from"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-3RK6DDJD.js";import{a as fe}from"./chunk-J2KWRDVH.js";import{a as lt,b as ct,f as pt}from"./chunk-7SVF5UPT.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as rt,b as at}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-YGEKAO5R.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as Y,e as j}from"./chunk-5JVEEL2T.js";import{b as et,c as h}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as oe}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as nt,n as ot}from"./chunk-CLER2MX6.js";import{A as ne,B as G,a as Je,c as ie,e as ue,h as $,i as W,l as _e,m as ze,n as X,q as J,r as Qe,s as z,t as qe,u as Ze,v as Ke,z as Q}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as tt,s as it}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as F,j as A,n as x}from"./chunk-M2FCTYGU.js";import{$c as T,Fc as me,Gb as v,Gc as f,Hb as se,Hc as te,Ic as Z,K as Be,Ka as P,Kc as je,Lc as He,M as Re,Mb as _,Mc as We,Oa as ke,Qc as S,Rc as de,Xb as Ge,Yb as c,Z as ee,Zb as Ee,ad as I,ca as $e,dc as k,ea as U,ec as L,f as Ue,g as Le,gc as B,hc as R,ic as p,ja as D,jc as r,jd as Xe,ka as pe,kc as d,lc as w,mc as O,oc as E,pa as u,rb as m,tc as y,uc as a,v as V,xa as N,xb as H,xc as Ye,ya as C,za as b}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var q=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}(q||{});var ae=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ae||{});var le=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}(le||{});var Me=class extends _e{setValue(s,e){if(s instanceof Date){let i=Math.floor(s.getTime()/1e3);super.setValue(i,e)}else super.setValue(s,e)}},De=(()=>{class t{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(Q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,o;return e=e.map(n=>(i=n?.multi_lang?.find(l=>l.language=="id"),n.attribute_value_list=n?.attribute_value_list?.map(l=>(o=l?.multi_lang?.find(g=>g.language=="id"),l.name=o?.value,l)),n.name=i?.value?i?.value:n.name,n)),e}createFormGroup(e){let i=this.formBuilder.group({}),o=[];return e.forEach(n=>{if(o=[],n.mandatory&&o.push(ue.required),n?.attribute_info?.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT&&n?.attribute_info?.input_type==q.FREE_TEXT_FILED){let l=this.formBuilder.group({unit:new _e(null),value:new _e(null,o)});i.addControl(JSON.stringify(n.attribute_id),l)}else n?.attribute_info?.input_type==q.FREE_TEXT_FILED&&n?.attribute_info?.input_validation_type==le.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(n.attribute_id),new Me(null,o)):i.addControl(JSON.stringify(n.attribute_id),this.formBuilder.control(null,o))}),i}getFilteredAttributes(e,i){let o=JSON.parse(JSON.stringify(e)),n=Object.keys(i),l=o.filter(g=>n.findIndex(Ae=>parseInt(Ae)==g.attribute_id||g.mandatory)!=-1);return l=this.filterSelectedAttributes(l,i),l}filterSelectedAttributes(e,i){return e.map(n=>{switch(n.attribute_info.input_type){case q.MULTI_COMBO_BOX:h.IsNotEmpty(i[n.attribute_id])?n.attribute_value_list=n.attribute_value_list.filter(l=>i[n.attribute_id]?.findIndex(g=>g==l.value_id)!=-1):n.attribute_value_list=[];break;case q.FREE_TEXT_FILED:n.attribute_info.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT?n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]?.value,i[n.attribute_id]?.unit):n.attribute_info.input_validation_type==le.VALIDATOR_DATE_TYPE?n.attribute_value_list=this.setSelectedDateAttr(i[n.attribute_id]):n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]);break;default:n.attribute_value_list=n.attribute_value_list.filter(l=>l.value_id==i[n.attribute_id])}return n}).filter(n=>n?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let o=[];if(h.IsNotEmpty(e)){let n={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(n.value_unit=i),o=[n]}return o}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();var Ie=(()=>{class t{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Lt=["class","component ts"];function Bt(t,s){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let o=a(2);return b(o.todayClicked())}),d(1,"i",4),r()}}function Rt(t,s){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let o=a(2);return b(o.clearClicked())}),d(1,"i",6),r()}}function $t(t,s){if(t&1&&(w(0),_(1,Bt,2,0,"button",1)(2,Rt,2,0,"button",2),O()),t&2){let e=s.ngIf;m(),c("ngIf",!e.hideBtnToday),m(),c("ngIf",!e.hideBtnClear)}}var kt=(()=>{class t{constructor(e,i,o,n,l){this._datePicker=e,this._calendar=i,this._dateAdapter=o,this.calendarService=n,this._destroyed=new Ue,i.stateChanges.pipe($e(this._destroyed)).subscribe(g=>l.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(H(Te),H(Ct),H(he),H(Ie),H(Xe))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,o){i&1&&(p(0,"mat-calendar-header"),_(1,$t,3,2,"ng-container",0),T(2,"async"),r()),i&2&&(m(),c("ngIf",I(2,1,o.calendarConfig$)))},dependencies:[F,ht,gt,A],encapsulation:2})}}return t})(),Et=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=pe({providers:[re],imports:[x,xe,ge,re,fe,Ce]})}}return t})();function Gt(t,s){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),r()()),t&2){let e=a();c("show",e.placeholder),m(2),te(e.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new P,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(H(Ie))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[S([{provide:he,useClass:St,deps:[st]},{provide:mt,useValue:Yt},{provide:Je,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,o){if(i&1){let n=E();p(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(n),b(o.change(g.value))})("click",function(){C(n);let g=me(6);return b(g.open())}),r(),p(3,"span",4),y("click",function(){C(n);let g=me(6);return b(g.open())}),d(4,"i",5),r(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(n),b(o.onOpenDatepicker())})("closed",function(){return C(n),b(o.onCloseDatepicker())}),r()()}if(i&2){let n=me(6);Ee("width",o.width||100,"%"),c("disabled",o.disabled)("appearance",o.appearance),m(),c("ngIf",o.isFloatingLabel&&o.placeholder),m(),Ye("placeholder",o.placeholder||""),c("matDatepicker",n)("min",o.minDateValidation)("max",o.maxDateValidation)("value",o.date==o.minDate?null:o.date)("disabled",o.disabled)("readonly",o.readOnly),Ge("data-cy",o.data_cy),m(),Ee("display",o.displayToggle?"unset":"none"),m(2),c("calendarHeaderComponent",o.headerComponent)}},dependencies:[F,Te,bt,pt,lt,ct,dt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
|
|
1
|
+
import{b as Ft}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as St}from"./chunk-O5LFGGB2.js";import{a as be,b as ut,c as _t,d as ye,e as ve}from"./chunk-2TRFYYCP.js";import{a as st,b as he,c as mt,d as ge,f as gt,g as Ct,h as Te,i as bt,o as re}from"./chunk-M5JQ7BGW.js";import{b as vt}from"./chunk-7UHCDGAA.js";import{a as ft}from"./chunk-3B2PNJWF.js";import"./chunk-JDIBETL5.js";import{b as ht,d as xe}from"./chunk-L7K5HOBY.js";import{a as Tt,b as It}from"./chunk-BFU7VKO3.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{b as xt}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-LOBNKJGT.js";import{a as yt}from"./chunk-M5XGP4SG.js";import{a as dt,b as Ce}from"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-3RK6DDJD.js";import{a as fe}from"./chunk-J2KWRDVH.js";import{a as lt,b as ct,f as pt}from"./chunk-7SVF5UPT.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as rt,b as at}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-UG7VRDLB.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as Y,e as j}from"./chunk-5JVEEL2T.js";import{b as et,c as h}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as oe}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as nt,n as ot}from"./chunk-CLER2MX6.js";import{A as ne,B as G,a as Je,c as ie,e as ue,h as $,i as W,l as _e,m as ze,n as X,q as J,r as Qe,s as z,t as qe,u as Ze,v as Ke,z as Q}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as tt,s as it}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as F,j as A,n as x}from"./chunk-M2FCTYGU.js";import{$c as T,Fc as me,Gb as v,Gc as f,Hb as se,Hc as te,Ic as Z,K as Be,Ka as P,Kc as je,Lc as He,M as Re,Mb as _,Mc as We,Oa as ke,Qc as S,Rc as de,Xb as Ge,Yb as c,Z as ee,Zb as Ee,ad as I,ca as $e,dc as k,ea as U,ec as L,f as Ue,g as Le,gc as B,hc as R,ic as p,ja as D,jc as r,jd as Xe,ka as pe,kc as d,lc as w,mc as O,oc as E,pa as u,rb as m,tc as y,uc as a,v as V,xa as N,xb as H,xc as Ye,ya as C,za as b}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var q=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}(q||{});var ae=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ae||{});var le=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}(le||{});var Me=class extends _e{setValue(s,e){if(s instanceof Date){let i=Math.floor(s.getTime()/1e3);super.setValue(i,e)}else super.setValue(s,e)}},De=(()=>{class t{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(Q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,o;return e=e.map(n=>(i=n?.multi_lang?.find(l=>l.language=="id"),n.attribute_value_list=n?.attribute_value_list?.map(l=>(o=l?.multi_lang?.find(g=>g.language=="id"),l.name=o?.value,l)),n.name=i?.value?i?.value:n.name,n)),e}createFormGroup(e){let i=this.formBuilder.group({}),o=[];return e.forEach(n=>{if(o=[],n.mandatory&&o.push(ue.required),n?.attribute_info?.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT&&n?.attribute_info?.input_type==q.FREE_TEXT_FILED){let l=this.formBuilder.group({unit:new _e(null),value:new _e(null,o)});i.addControl(JSON.stringify(n.attribute_id),l)}else n?.attribute_info?.input_type==q.FREE_TEXT_FILED&&n?.attribute_info?.input_validation_type==le.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(n.attribute_id),new Me(null,o)):i.addControl(JSON.stringify(n.attribute_id),this.formBuilder.control(null,o))}),i}getFilteredAttributes(e,i){let o=JSON.parse(JSON.stringify(e)),n=Object.keys(i),l=o.filter(g=>n.findIndex(Ae=>parseInt(Ae)==g.attribute_id||g.mandatory)!=-1);return l=this.filterSelectedAttributes(l,i),l}filterSelectedAttributes(e,i){return e.map(n=>{switch(n.attribute_info.input_type){case q.MULTI_COMBO_BOX:h.IsNotEmpty(i[n.attribute_id])?n.attribute_value_list=n.attribute_value_list.filter(l=>i[n.attribute_id]?.findIndex(g=>g==l.value_id)!=-1):n.attribute_value_list=[];break;case q.FREE_TEXT_FILED:n.attribute_info.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT?n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]?.value,i[n.attribute_id]?.unit):n.attribute_info.input_validation_type==le.VALIDATOR_DATE_TYPE?n.attribute_value_list=this.setSelectedDateAttr(i[n.attribute_id]):n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]);break;default:n.attribute_value_list=n.attribute_value_list.filter(l=>l.value_id==i[n.attribute_id])}return n}).filter(n=>n?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let o=[];if(h.IsNotEmpty(e)){let n={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(n.value_unit=i),o=[n]}return o}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();var Ie=(()=>{class t{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Lt=["class","component ts"];function Bt(t,s){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let o=a(2);return b(o.todayClicked())}),d(1,"i",4),r()}}function Rt(t,s){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let o=a(2);return b(o.clearClicked())}),d(1,"i",6),r()}}function $t(t,s){if(t&1&&(w(0),_(1,Bt,2,0,"button",1)(2,Rt,2,0,"button",2),O()),t&2){let e=s.ngIf;m(),c("ngIf",!e.hideBtnToday),m(),c("ngIf",!e.hideBtnClear)}}var kt=(()=>{class t{constructor(e,i,o,n,l){this._datePicker=e,this._calendar=i,this._dateAdapter=o,this.calendarService=n,this._destroyed=new Ue,i.stateChanges.pipe($e(this._destroyed)).subscribe(g=>l.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(H(Te),H(Ct),H(he),H(Ie),H(Xe))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,o){i&1&&(p(0,"mat-calendar-header"),_(1,$t,3,2,"ng-container",0),T(2,"async"),r()),i&2&&(m(),c("ngIf",I(2,1,o.calendarConfig$)))},dependencies:[F,ht,gt,A],encapsulation:2})}}return t})(),Et=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=pe({providers:[re],imports:[x,xe,ge,re,fe,Ce]})}}return t})();function Gt(t,s){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),r()()),t&2){let e=a();c("show",e.placeholder),m(2),te(e.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new P,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(H(Ie))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[S([{provide:he,useClass:St,deps:[st]},{provide:mt,useValue:Yt},{provide:Je,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,o){if(i&1){let n=E();p(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(n),b(o.change(g.value))})("click",function(){C(n);let g=me(6);return b(g.open())}),r(),p(3,"span",4),y("click",function(){C(n);let g=me(6);return b(g.open())}),d(4,"i",5),r(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(n),b(o.onOpenDatepicker())})("closed",function(){return C(n),b(o.onCloseDatepicker())}),r()()}if(i&2){let n=me(6);Ee("width",o.width||100,"%"),c("disabled",o.disabled)("appearance",o.appearance),m(),c("ngIf",o.isFloatingLabel&&o.placeholder),m(),Ye("placeholder",o.placeholder||""),c("matDatepicker",n)("min",o.minDateValidation)("max",o.maxDateValidation)("value",o.date==o.minDate?null:o.date)("disabled",o.disabled)("readonly",o.readOnly),Ge("data-cy",o.data_cy),m(),Ee("display",o.displayToggle?"unset":"none"),m(2),c("calendarHeaderComponent",o.headerComponent)}},dependencies:[F,Te,bt,pt,lt,ct,dt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
|
|
2
2
|
`],encapsulation:2})}}return t})(),Dt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=pe({providers:[re],imports:[x,xe,ge,re,fe,Ce,Et,vt]})}}return t})();var Ne=()=>[];function Ht(t,s){t&1&&(p(0,"span",5),f(1,"*"),r())}function Wt(t,s){if(t&1&&d(0,"ng-select",6),t&2){let e=a().$implicit;c("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:de(4,Ne))("placeholder","Pilih "+(e==null?null:e.name))}}function Xt(t,s){if(t&1&&d(0,"input",8),t&2){let e=a(2).$implicit;c("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function Jt(t,s){if(t&1&&(p(0,"option",15),f(1),r()),t&2){let e=s.$implicit;c("value",e),m(),te(e)}}function zt(t,s){if(t&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),f(4,"Unit"),r(),B(5,Jt,2,2,"option",15,L),r()()),t&2){let e=a(3).$implicit;c("formGroupName",e.attribute_id),m(),c("placeholder","Isi "+(e==null?null:e.name)),m(2),c("value",null),m(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Qt(t,s){if(t&1&&d(0,"input",11),t&2){let e=a(3).$implicit;c("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function qt(t,s){if(t&1&&_(0,zt,7,3,"div",10)(1,Qt,1,2,"input",11),t&2){let e=a(2).$implicit,i=a(2);k((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function Zt(t,s){if(t&1&&d(0,"datepicker",9),t&2){let e=a(2).$implicit;c("formControlName",e.attribute_id)}}function Kt(t,s){if(t&1&&_(0,Xt,1,2,"input",8)(1,qt,2,1)(2,Zt,1,1,"datepicker",9),t&2){let e,i=a().$implicit,o=a(2);k((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===o.validationType.VALIDATOR_STRING_TYPE?0:e===o.validationType.VALIDATOR_FLOAT_TYPE?1:e===o.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ei(t,s){if(t&1&&d(0,"ng-select",7),t&2){let e=a().$implicit;c("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:de(3,Ne))("placeholder","Pilih "+(e==null?null:e.name))}}function ti(t,s){if(t&1&&d(0,"ng-select",7),t&2){let e=a().$implicit;c("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:de(3,Ne))("placeholder","Pilih "+(e==null?null:e.name))}}function ii(t,s){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,Ht,2,0,"span",5),p(3,"span"),f(4),r()(),_(5,Wt,1,5,"ng-select",6)(6,Kt,3,1)(7,ei,1,4,"ng-select",7)(8,ti,1,4,"ng-select",7),r()),t&2){let e,i=s.$implicit,o=a(2);m(2),k(i.mandatory?2:-1),m(2),Z(" ",i==null?null:i.name," "),m(),k((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===o.inputType.MULTI_COMBO_BOX?5:e===o.inputType.FREE_TEXT_FILED?6:e===o.inputType.SINGLE_COMBO_BOX?7:8)}}function ni(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2),B(3,ii,9,3,"div",3,L),r()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(2),R(e)}}var Nt=(()=>{class t{constructor(){this.formCategoryService=u(De),this.attributesChanges=new P,this.inputType=q,this.formatType=ae,this.validationType=le}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(o=>{i=this.formCategoryService.getFilteredAttributes(e,o),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[S([De]),N],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,o){i&1&&(_(0,ni,5,1,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,j,Y,G,X,Ze,Ke,ie,qe,$,W,J,z,Qe,yt,Dt,Mt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return t})();var Pe=(()=>{class t{constructor(){this.httpService=u(oe),this.formBuilder=u(Q),this.uploadProductService=u(ve)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Be(n=>this.uploadProductService.selectedProduct$.pipe(V(l=>(n=this.mappingAttributeSalesProperty(n,l),n)))))}mappingAttributeSalesProperty(e,i){let o=0;return e.filter(n=>(n.type=="SALES_PROPERTY"&&(o+=1),o>1?(o=0,!1):!0)).map(n=>(n.type=="SALES_PROPERTY"&&(n.name="Jenis Variant",n.is_multiple_selection=!1,n.is_required=this.isProductHasMoreVariant(i),n.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),n))}isProductHasMoreVariant(e){let i=!1,o=[];return e.forEach(n=>{n.Variants&&o.push(n.Variants.length)}),i=o.some(n=>n>1),i}createFormGroup(e){let i=this.formBuilder.group({}),o=[];return e.forEach(n=>{o=[],n.is_required&&o.push(ue.required),i.addControl(n.id,this.formBuilder.control(null,o))}),i}getFilteredAttributes(e,i){let o=JSON.parse(JSON.stringify(e)),n=Object.keys(i),l=o.filter(g=>n.findIndex(Ae=>parseInt(Ae)==g.id)!=-1);return l=this.filterSelectedAttributes(l,i),l}filterSelectedAttributes(e,i){return e.map(n=>(h.IsNotEmpty(n.values)?n.is_multiple_selection?n.values=n.values.filter(l=>i[n.id]?.includes(l.id)):n.values=n.values.filter(l=>l.id==i[n.id]):i[n.id]&&(n.values=[{id:null,name:i[n.id]}]),n)).filter(n=>n?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();function oi(t,s){t&1&&(p(0,"span",5),f(1,"*"),r())}function ri(t,s){if(t&1&&d(0,"ng-select",6),t&2){let e=a().$implicit;c("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function ai(t,s){if(t&1&&d(0,"ng-select",7),t&2){let e=a().$implicit;c("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function li(t,s){if(t&1&&d(0,"input",8),t&2){let e=a().$implicit;c("formControlName",e.id)("placeholder",e==null?null:e.name)}}function ci(t,s){if(t&1&&(p(0,"small",5),f(1),r()),t&2){let e=a().$implicit;m(),Z(" ",e==null?null:e.name," is mandatory ")}}function pi(t,s){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,oi,2,0,"span",5),p(3,"span"),f(4),r()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,1,2,"input",8)(8,ci,2,1,"small",5),r()),t&2){let e=s.$implicit;m(2),k(e.is_required?2:-1),m(2),Z(" ",e==null?null:e.name," "),m(),k(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),m(3),k(e.is_required?8:-1)}}function si(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2),B(3,pi,9,4,"div",3,L),r()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(2),R(e)}}var Pt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Pe),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(o=>{i=this.tiktokAttributeFormService.getFilteredAttributes(e,o),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[S([Pe]),N],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,o){i&1&&(_(0,si,5,1,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,j,Y,G,X,ie,$,W,J,z,ne],encapsulation:2})}}return t})();var we=(()=>{class t{constructor(){this.woocommerceUploadService=u(ye)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(o=>o.map(n=>({key:n.name,label:n.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();var wt=(()=>{class t{constructor(){this.wooAttributeFormService=u(we),this.channelId=ke(),this.categoryId=ke(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[S([we]),N],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,o){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),r(),p(4,"ng-select",3),T(5,"async"),y("change",function(l){return o.onSelectAttribute(l)}),r()()()),i&2&&(m(4),c("items",I(5,1,o.attributes$)))},dependencies:[x,A,ne,j,Y,G],encapsulation:2})}}return t})();var Oe=(()=>{class t{constructor(){this.httpService=u(oe),this.formBuilder=u(Q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(n=>n))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(o=>{i.addControl(o.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(o=>o!==null).map(o=>JSON.stringify(o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();function mi(t,s){if(t&1&&(p(0,"div",3)(1,"div",4),f(2),r(),d(3,"ng-select",5),r()),t&2){let e=s.$implicit;m(2),Z(" ",e==null?null:e.variant," "),m(),c("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function di(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2),B(3,mi,4,4,"div",3,L),r()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(2),R(e)}}var Ot=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Oe),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[S([Oe]),N],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,o){i&1&&(_(0,di,5,1,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,j,Y,G,X,$,W,J,z],encapsulation:2})}}return t})();var Ve=(()=>{class t{constructor(){this.httpService=u(oe),this.formBuilder=u(Q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(o=>(o.Options.StatusOptions=o.Options.Status.map(n=>({id:n,name:n})),o)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(n=>{i.addControl(n,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();function ui(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),r(),d(6,"input",5),r(),p(7,"div",6)(8,"div",4),f(9," Product Type "),r(),d(10,"input",7),r(),p(11,"div",6)(12,"div",4),f(13," Status "),r(),d(14,"ng-select",8),r()()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(13),c("items",e.Options.StatusOptions)}}var Vt=(()=>{class t{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(Ve)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Re(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[S([Ve]),N],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,o){i&1&&(_(0,ui,15,2,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,G,X,ie,$,W,J,z,j,Y],encapsulation:2})}}return t})();function _i(t,s){if(t&1&&(p(0,"div",6),d(1,"app-product-card",9),r()),t&2){let e=s.$implicit;m(),c("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 fi(t,s){if(t&1){let e=E();w(0),p(1,"mat-checkbox",21),We("ngModelChange",function(o){C(e);let n=a().$implicit;return He(n.selected,o)||(n.selected=o),b(o)}),y("ngModelChange",function(){let o=C(e).ngIf,n=a(),l=n.$implicit,g=n.$index,ce=a();return b(ce.onSelectChannel(l,g,o))}),r(),O()}if(t&2){let e=a().$implicit;m(),je("ngModel",e.selected)}}function hi(t,s){if(t&1&&(p(0,"div",18),d(1,"input",22),r()),t&2){let e=a().$implicit,i=a();c("matTooltip",e.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function gi(t,s){if(t&1){let e=E();p(0,"app-channel-category-select",23),y("selectedCategory",function(o){C(e);let n=a().$index,l=a();return b(l.onCategoryChange(n,o))}),r()}if(t&2){let e=a().$implicit,i=a();c("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ci(t,s){if(t&1){let e=E();p(0,"shopee-attribute-form",27),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function bi(t,s){if(t&1){let e=E();p(0,"tiktok-attribute-form",28),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)}}function yi(t,s){if(t&1){let e=E();p(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)}}function vi(t,s){if(t&1){let e=E();p(0,"tokopedia-attribute-form",28),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)}}function xi(t,s){if(t&1&&(p(0,"div",20)(1,"div",24),_(2,Ci,1,3,"shopee-attribute-form",25)(3,bi,1,2,"tiktok-attribute-form",26)(4,yi,1,2,"wooocommerce-attribute-form",26)(5,vi,1,2,"tokopedia-attribute-form",26),r()()),t&2){let e,i=a().$implicit,o=a();m(2),k((e=i.type)===o.channelType.Shopee?2:e===o.channelType.Tiktok?3:e===o.channelType.WooCommerce?4:e===o.channelType.Tokopedia?5:-1)}}function Ti(t,s){if(t&1){let e=E();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),y("attributesChanges",function(o){C(e);let n=a().$index,l=a();return b(l.onAttributesChange(n,o))}),r()()()}if(t&2){let e=a().$implicit;m(2),c("channelId",e.id)}}function Ii(t,s){if(t&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,fi,2,1,"ng-container",14),T(7,"async"),r(),p(8,"div"),d(9,"app-channel-logo",15),r(),p(10,"div",16)(11,"span"),f(12),r()()()(),p(13,"div",12)(14,"div",17),_(15,hi,2,1,"div",18)(16,gi,1,4,"app-channel-category-select",19),r()()(),_(17,xi,6,1,"div",20)(18,Ti,3,1,"div",20),r()()),t&2){let e=s.$implicit,i=a();m(6),c("ngIf",I(7,8,i.defaultCategories$)),m(3),c("typeId",e.type)("showChannelName",!1),m(),c("matTooltip",e.name)("matTooltipShowDelay",2500),m(2),te(e.name),m(3),k(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo?15:16),m(2),k(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:i.channelType.Shopify==e.type&&e.selected?18:-1)}}var br=(()=>{class t{constructor(){this.uploadProductService=u(ve),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=et,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,i){this.channelProductUploads.update(o=>o.map((n,l)=>(l==e&&(n.categoryId=i,n.attributes=[]),n)))}onAttributesChange(e,i){this.channelProductUploads.update(o=>o.map((n,l)=>(l==e&&(n.attributes=i),n)))}onSelectChannel(e,i,o){this.channelProductUploads.update(n=>n.map((l,g)=>{if(g==i&&e.selected){let ce=this.findCategoryByChannelId(e.id,o);l.categoryId=ce?.DefaultCategoryID}return g==i&&!e.selected&&(l.categoryId=null),l}))}findCategoryByChannelId(e,i){return i.find(o=>o.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[S([be,ut,_t,ye])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,o){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return o.onUploadProduct()}),d(3,"i",2),f(4," Upload "),r()(),p(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),r(),p(9,"div",5),B(10,_i,2,7,"div",6,L),T(12,"async"),r(),p(13,"h3",7),f(14,"Channel To Upload"),r(),B(15,Ii,19,10,"div",8,L),r()()()),i&2){let n;c("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),c("disabled",((n=o.channelProductUploads())==null?null:n.length)==0),m(8),R(I(12,3,o.selectedProducts$)),m(5),R(o.channelProductUploads())}},dependencies:[x,F,A,xt,ot,nt,It,Tt,at,rt,ne,$,ze,it,tt,Pt,wt,Ot,Vt,ft,Ft,Nt],encapsulation:2})}}return t})();export{br as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as u}from"./chunk-
|
|
1
|
+
import{h as u}from"./chunk-UG7VRDLB.js";import{a as p}from"./chunk-SWQXSJ7O.js";import{b as l}from"./chunk-JXSBFTQM.js";import{G as c}from"./chunk-M2FCTYGU.js";import{ja as a,oa as t}from"./chunk-B7KTCPKC.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(l),t(u),t(c),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
|