marketplacepos 3.14.0 → 3.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/Marketplace/{chunk-U75FY3SB.js → chunk-26HKN7YV.js} +1 -1
  2. package/Marketplace/{chunk-2U52BOK6.js → chunk-3WGDHGSC.js} +7 -7
  3. package/Marketplace/{chunk-MOFF6ASU.js → chunk-57XFPFTU.js} +1 -1
  4. package/Marketplace/{chunk-O2WRF4JL.js → chunk-7OUOPJNV.js} +1 -1
  5. package/Marketplace/{chunk-H5G3XI3T.js → chunk-CAXMTBHH.js} +1 -1
  6. package/Marketplace/{chunk-7SN6N4WR.js → chunk-EJ5OYNY3.js} +1 -1
  7. package/Marketplace/{chunk-F6UMOF3O.js → chunk-FELGHSYN.js} +1 -1
  8. package/Marketplace/{chunk-WVF7SHZL.js → chunk-FGYTQIJ5.js} +1 -1
  9. package/Marketplace/{chunk-Q7FQTBT6.js → chunk-FTVIBNXQ.js} +1 -1
  10. package/Marketplace/{chunk-VQQXE7MA.js → chunk-HIVRWPHI.js} +1 -1
  11. package/Marketplace/{chunk-ZPUPB7UU.js → chunk-HWUMVID7.js} +1 -1
  12. package/Marketplace/{chunk-HNOVDG7D.js → chunk-JDKWQEVP.js} +1 -1
  13. package/Marketplace/{chunk-5DAS2XHT.js → chunk-JWI6NSSG.js} +1 -1
  14. package/Marketplace/{chunk-HRKBU5UW.js → chunk-KGINCJJU.js} +1 -1
  15. package/Marketplace/{chunk-LBHJSQBZ.js → chunk-KGNFBVTF.js} +1 -1
  16. package/Marketplace/{chunk-D6ANC3SS.js → chunk-NCNHP5BH.js} +1 -1
  17. package/Marketplace/{chunk-SZX66K7N.js → chunk-OQWLBQEH.js} +1 -1
  18. package/Marketplace/{chunk-AQJ4BQQR.js → chunk-OY6H4LKT.js} +1 -1
  19. package/Marketplace/{chunk-27KRVOVV.js → chunk-RX2NCNAM.js} +1 -1
  20. package/Marketplace/{chunk-6PK2RRGP.js → chunk-UEZ3MCEP.js} +1 -1
  21. package/Marketplace/{chunk-U7BIKZZA.js → chunk-UHE3QQB5.js} +1 -1
  22. package/Marketplace/{chunk-FTV52HXX.js → chunk-VOSKUYZN.js} +1 -1
  23. package/Marketplace/{chunk-5RBA5Q4C.js → chunk-Z3E6ZJZB.js} +1 -1
  24. package/Marketplace/{chunk-ARA5O5PX.js → chunk-ZWGSECG3.js} +1 -1
  25. package/Marketplace/index.html +2 -2
  26. package/Marketplace/{main-SOGOPFYM.js → main-KVPKHKMN.js} +1 -1
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as b}from"./chunk-V4UFHWKE.js";import{a as h,b as P}from"./chunk-HXDXTE2F.js";import{a as C}from"./chunk-YZ42FKNJ.js";import{b as O}from"./chunk-QZKWUCMY.js";import"./chunk-MSVZKMTY.js";import{c as M}from"./chunk-2LGY3VGP.js";import"./chunk-RZ7FKABW.js";import{e as s}from"./chunk-S5GA4AVB.js";import{a as p}from"./chunk-U7BIKZZA.js";import"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import"./chunk-LBHJSQBZ.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{m as u}from"./chunk-4R22UO7N.js";import{u as f}from"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{u as g}from"./chunk-B3LBEB32.js";import"./chunk-QPRFFPO5.js";import{Cc as i,aa as e,fd as l,ga as d,ha as r,jd as m,nb as c}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&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}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-6PK2RRGP.js").then(o=>o.StatusModule),canActivate:[p]},{path:"download",loadChildren:()=>import("./chunk-AQJ4BQQR.js").then(o=>o.DownloadModule),canActivate:[p]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,m.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,m,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
1
+ import{a as b}from"./chunk-V4UFHWKE.js";import{a as h,b as P}from"./chunk-HXDXTE2F.js";import{a as C}from"./chunk-YZ42FKNJ.js";import{b as O}from"./chunk-QZKWUCMY.js";import"./chunk-MSVZKMTY.js";import{c as M}from"./chunk-2LGY3VGP.js";import"./chunk-RZ7FKABW.js";import{e as s}from"./chunk-S5GA4AVB.js";import{a as p}from"./chunk-UHE3QQB5.js";import"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import"./chunk-KGNFBVTF.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{m as u}from"./chunk-4R22UO7N.js";import{u as f}from"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{u as g}from"./chunk-B3LBEB32.js";import"./chunk-QPRFFPO5.js";import{Cc as i,aa as e,fd as l,ga as d,ha as r,jd as m,nb as c}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&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}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-UEZ3MCEP.js").then(o=>o.StatusModule),canActivate:[p]},{path:"download",loadChildren:()=>import("./chunk-OY6H4LKT.js").then(o=>o.DownloadModule),canActivate:[p]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,m.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,m,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
@@ -1 +1 @@
1
- import"./chunk-WXUKZFAH.js";import{a as ve}from"./chunk-F6UMOF3O.js";import{c as we}from"./chunk-VQQXE7MA.js";import"./chunk-J47B3BJQ.js";import"./chunk-6U6JR5K6.js";import{b as ke}from"./chunk-MSVZKMTY.js";import{c as ze}from"./chunk-2LGY3VGP.js";import{e as be}from"./chunk-S5GA4AVB.js";import{a as p}from"./chunk-U7BIKZZA.js";import"./chunk-VOWLO2M7.js";import{b as Se}from"./chunk-YG3KQ63T.js";import{a as M}from"./chunk-662E5VTA.js";import{c as Te}from"./chunk-IPYNDMGQ.js";import{g as Pe}from"./chunk-KWFES5F7.js";import{a as le,b as ge,g as ue}from"./chunk-LBHJSQBZ.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{a as _e,g as Oe,j as Ee,m as Ie}from"./chunk-4R22UO7N.js";import{t as ye,u as S}from"./chunk-MVPTQRFO.js";import{F as xe,K as $,u as Ce,x as Me}from"./chunk-EKCNJX26.js";import{u as pe}from"./chunk-B3LBEB32.js";import{e as fe,f as he}from"./chunk-QPRFFPO5.js";import{$a as c,Cc as T,Da as q,Ha as Z,Hb as z,Ia as r,Ib as g,Ja as d,Jb as P,Kb as C,Oa as Y,Pa as Q,Qb as K,Ya as X,Za as f,Zb as L,_b as U,aa as h,ac as k,bb as O,da as v,db as R,fc as ee,fd as me,ga as y,gb as J,ha as u,hd as de,ia as V,id as ce,jc as w,jd as j,la as G,lb as s,mb as l,nb as b,ob as E,oc as te,pb as I,q as H,qc as ie,sc as ne,ub as B,uc as ae,vc as oe,wb as m,ya as W,yc as re,zc as se}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var D=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[M.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[M.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Log",Url:"/menu/sync-log",Roles:[M.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[M.channelView]},{Icon:"fas fa-file-alt",Title:"Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fas fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${ge.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var je=0,De="mat-badge-content",A=new Set,$e=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["ng-component"]],standalone:!0,features:[K],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let e=t;return e})(),Ae=(()=>{let t=class t{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,_,Ue){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=_,this._animationMode=Ue,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=je++,this._isInitialized=!1,this._interactivityChecker=v(Me),this._document=v(ie);let x=v(ee);if(!A.has(x)){A.add(x);let F=te($e,{environmentInjector:v(G)});x.onDestroy(()=>{A.delete(x),A.size===0&&F.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(De),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${De}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};t.\u0275fac=function(n){return new(n||t)(d(Q),d(W),d(Ce),d(Y),d(q,8))},t.\u0275dir=V({type:t,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&O("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",w],disabled:[2,"matBadgeDisabled","disabled",w],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",w]},standalone:!0,features:[X]});let e=t;return e})(),Ne=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({imports:[xe,$,$]});let e=t;return e})();function He(e,t){if(e&1&&(E(0),s(1,"p",23),g(2),l(),I()),e&2){let o=m(3).$implicit;r(2),C(" ",o.Title," ")}}function Ve(e,t){if(e&1&&(s(0,"p"),g(1),l()),e&2){let o=m(3).$implicit;r(),P(o.Title)}}function Ge(e,t){if(e&1&&(s(0,"a",22),b(1,"i"),f(2,He,3,1,"ng-container",20)(3,Ve,2,1,"ng-template",null,1,k),l()),e&2){let o=z(4),i=m(2).$implicit;c("href",i.Url,Z),r(),R(i.Icon),r(),c("ngIf",i.Badge)("ngIfElse",o)}}function We(e,t){if(e&1&&(E(0),f(1,Ge,5,5,"a",21),I()),e&2){let o=m().$implicit;r(),c("ngxPermissionsOnly",o.Roles)}}function qe(e,t){if(e&1&&(s(0,"p",23),g(1),l()),e&2){let o=m(4).$implicit;r(),C(" ",o.Title," ")}}function Ze(e,t){if(e&1&&(s(0,"p"),g(1),l()),e&2){let o=m(4).$implicit;r(),P(o.Title)}}function Ye(e,t){if(e&1&&(E(0),f(1,qe,2,1,"p",23),L(2,"async"),f(3,Ze,2,1,"p"),I()),e&2){let o=m(4);r(),J(U(2,1,o.notifications$)!=0?1:3)}}function Qe(e,t){if(e&1&&(s(0,"p"),g(1),l()),e&2){let o=m(3).$implicit;r(),P(o.Title)}}function Xe(e,t){if(e&1&&(s(0,"a",25),b(1,"i"),f(2,Ye,4,3,"ng-container",20)(3,Qe,2,1,"ng-template",null,2,k),l()),e&2){let o=z(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),R(i.Icon),r(),c("ngIf",i.Badge)("ngIfElse",o)}}function Je(e,t){if(e&1&&f(0,Xe,5,6,"a",24),e&2){let o=m().$implicit;c("ngxPermissionsOnly",o.Roles)}}function Ke(e,t){if(e&1&&(s(0,"li",19),f(1,We,2,1,"ng-container",20)(2,Je,1,1,"ng-template",null,0,k),l()),e&2){let o=t.$implicit,i=z(3);r(),c("ngIf",o.ExternalLink)("ngIfElse",i)}}var Re=(()=>{let t=class t{constructor(i,n,a,_){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=_,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new D().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(H(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};t.\u0275fac=function(n){return new(n||t)(d(_e),d(ve),d(le),d(ue))},t.\u0275cmp=y({type:t,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(s(0,"div",3),L(1,"async"),s(2,"div",4)(3,"button",5),B("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),l(),s(5,"div",7)(6,"div",8)(7,"a",9),g(8),l(),s(9,"div",10)(10,"div",11),g(11),l(),b(12,"div",12),s(13,"a",13),B("click",function(){return a.onLogout()}),b(14,"i",14),g(15,"\xA0 "),s(16,"span"),g(17," Log Out"),l()()()()(),s(18,"div",15)(19,"ul",16),f(20,Ke,4,2,"li",17),l()()(),s(21,"div",18),b(22,"router-outlet"),l()()),n&2&&(O("nav-open",U(1,7,a.toggleState$)),r(2),c("ngClass",a.isCollapseSidebar?"collapses":""),r(2),c("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),C(" ",a.storeName," "),r(3),C(" ",a.token==null?null:a.token.LID," "),r(9),c("ngForOf",a.Menu))},dependencies:[ne,ae,oe,me,de,ce,ye,Ae,fe,re],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let e=t;return e})();var et=[{path:"",component:Re,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-RXRML6X2.js").then(e=>e.DashboardModule),canActivate:[p],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-WVF7SHZL.js").then(e=>e.ProductModule),canActivate:[p],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-5RBA5Q4C.js").then(e=>e.InventoryRoutingModule),canActivate:[p],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-HNOVDG7D.js").then(e=>e.PriceRoutingModule),canActivate:[p],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-2U52BOK6.js").then(e=>e.OrdersModule),canActivate:[p],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-H5G3XI3T.js").then(e=>e.ReportModule),canActivate:[p],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-SZX66K7N.js").then(e=>e.LogisticModule),canActivate:[p],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-U75FY3SB.js").then(e=>e.ChannelsModule),canActivate:[p],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-27KRVOVV.js").then(e=>e.LogsModule),canActivate:[p],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-HRKBU5UW.js").then(e=>e.NotificationModule),canActivate:[p],data:{title:"Push Notification"}}]}],Be=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({imports:[j.forChild(et),j]});let e=t;return e})();var Le=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({imports:[T,pe,Oe,ze,Te,Pe,ke,Se,S,Ee,we,be]});let e=t;return e})();var xi=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({providers:[se],imports:[T,Be,Ie,S,Le,Ne,he.forChild()]});let e=t;return e})();export{xi as MenuModule};
1
+ import"./chunk-WXUKZFAH.js";import{a as ve}from"./chunk-FELGHSYN.js";import{c as we}from"./chunk-HIVRWPHI.js";import"./chunk-J47B3BJQ.js";import"./chunk-6U6JR5K6.js";import{b as ke}from"./chunk-MSVZKMTY.js";import{c as ze}from"./chunk-2LGY3VGP.js";import{e as be}from"./chunk-S5GA4AVB.js";import{a as p}from"./chunk-UHE3QQB5.js";import"./chunk-VOWLO2M7.js";import{b as Se}from"./chunk-YG3KQ63T.js";import{a as M}from"./chunk-662E5VTA.js";import{c as Te}from"./chunk-IPYNDMGQ.js";import{g as Pe}from"./chunk-KWFES5F7.js";import{a as le,b as ge,g as ue}from"./chunk-KGNFBVTF.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{a as _e,g as Oe,j as Ee,m as Ie}from"./chunk-4R22UO7N.js";import{t as ye,u as S}from"./chunk-MVPTQRFO.js";import{F as xe,K as $,u as Ce,x as Me}from"./chunk-EKCNJX26.js";import{u as pe}from"./chunk-B3LBEB32.js";import{e as fe,f as he}from"./chunk-QPRFFPO5.js";import{$a as c,Cc as T,Da as q,Ha as Z,Hb as z,Ia as r,Ib as g,Ja as d,Jb as P,Kb as C,Oa as Y,Pa as Q,Qb as K,Ya as X,Za as f,Zb as L,_b as U,aa as h,ac as k,bb as O,da as v,db as R,fc as ee,fd as me,ga as y,gb as J,ha as u,hd as de,ia as V,id as ce,jc as w,jd as j,la as G,lb as s,mb as l,nb as b,ob as E,oc as te,pb as I,q as H,qc as ie,sc as ne,ub as B,uc as ae,vc as oe,wb as m,ya as W,yc as re,zc as se}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var D=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[M.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[M.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Log",Url:"/menu/sync-log",Roles:[M.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[M.channelView]},{Icon:"fas fa-file-alt",Title:"Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fas fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${ge.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var je=0,De="mat-badge-content",A=new Set,$e=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=y({type:t,selectors:[["ng-component"]],standalone:!0,features:[K],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let e=t;return e})(),Ae=(()=>{let t=class t{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,_,Ue){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=_,this._animationMode=Ue,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=je++,this._isInitialized=!1,this._interactivityChecker=v(Me),this._document=v(ie);let x=v(ee);if(!A.has(x)){A.add(x);let F=te($e,{environmentInjector:v(G)});x.onDestroy(()=>{A.delete(x),A.size===0&&F.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(De),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${De}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};t.\u0275fac=function(n){return new(n||t)(d(Q),d(W),d(Ce),d(Y),d(q,8))},t.\u0275dir=V({type:t,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&O("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",w],disabled:[2,"matBadgeDisabled","disabled",w],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",w]},standalone:!0,features:[X]});let e=t;return e})(),Ne=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({imports:[xe,$,$]});let e=t;return e})();function He(e,t){if(e&1&&(E(0),s(1,"p",23),g(2),l(),I()),e&2){let o=m(3).$implicit;r(2),C(" ",o.Title," ")}}function Ve(e,t){if(e&1&&(s(0,"p"),g(1),l()),e&2){let o=m(3).$implicit;r(),P(o.Title)}}function Ge(e,t){if(e&1&&(s(0,"a",22),b(1,"i"),f(2,He,3,1,"ng-container",20)(3,Ve,2,1,"ng-template",null,1,k),l()),e&2){let o=z(4),i=m(2).$implicit;c("href",i.Url,Z),r(),R(i.Icon),r(),c("ngIf",i.Badge)("ngIfElse",o)}}function We(e,t){if(e&1&&(E(0),f(1,Ge,5,5,"a",21),I()),e&2){let o=m().$implicit;r(),c("ngxPermissionsOnly",o.Roles)}}function qe(e,t){if(e&1&&(s(0,"p",23),g(1),l()),e&2){let o=m(4).$implicit;r(),C(" ",o.Title," ")}}function Ze(e,t){if(e&1&&(s(0,"p"),g(1),l()),e&2){let o=m(4).$implicit;r(),P(o.Title)}}function Ye(e,t){if(e&1&&(E(0),f(1,qe,2,1,"p",23),L(2,"async"),f(3,Ze,2,1,"p"),I()),e&2){let o=m(4);r(),J(U(2,1,o.notifications$)!=0?1:3)}}function Qe(e,t){if(e&1&&(s(0,"p"),g(1),l()),e&2){let o=m(3).$implicit;r(),P(o.Title)}}function Xe(e,t){if(e&1&&(s(0,"a",25),b(1,"i"),f(2,Ye,4,3,"ng-container",20)(3,Qe,2,1,"ng-template",null,2,k),l()),e&2){let o=z(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),R(i.Icon),r(),c("ngIf",i.Badge)("ngIfElse",o)}}function Je(e,t){if(e&1&&f(0,Xe,5,6,"a",24),e&2){let o=m().$implicit;c("ngxPermissionsOnly",o.Roles)}}function Ke(e,t){if(e&1&&(s(0,"li",19),f(1,We,2,1,"ng-container",20)(2,Je,1,1,"ng-template",null,0,k),l()),e&2){let o=t.$implicit,i=z(3);r(),c("ngIf",o.ExternalLink)("ngIfElse",i)}}var Re=(()=>{let t=class t{constructor(i,n,a,_){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=_,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new D().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(H(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};t.\u0275fac=function(n){return new(n||t)(d(_e),d(ve),d(le),d(ue))},t.\u0275cmp=y({type:t,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(s(0,"div",3),L(1,"async"),s(2,"div",4)(3,"button",5),B("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),l(),s(5,"div",7)(6,"div",8)(7,"a",9),g(8),l(),s(9,"div",10)(10,"div",11),g(11),l(),b(12,"div",12),s(13,"a",13),B("click",function(){return a.onLogout()}),b(14,"i",14),g(15,"\xA0 "),s(16,"span"),g(17," Log Out"),l()()()()(),s(18,"div",15)(19,"ul",16),f(20,Ke,4,2,"li",17),l()()(),s(21,"div",18),b(22,"router-outlet"),l()()),n&2&&(O("nav-open",U(1,7,a.toggleState$)),r(2),c("ngClass",a.isCollapseSidebar?"collapses":""),r(2),c("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),C(" ",a.storeName," "),r(3),C(" ",a.token==null?null:a.token.LID," "),r(9),c("ngForOf",a.Menu))},dependencies:[ne,ae,oe,me,de,ce,ye,Ae,fe,re],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let e=t;return e})();var et=[{path:"",component:Re,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-RXRML6X2.js").then(e=>e.DashboardModule),canActivate:[p],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-FGYTQIJ5.js").then(e=>e.ProductModule),canActivate:[p],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-Z3E6ZJZB.js").then(e=>e.InventoryRoutingModule),canActivate:[p],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-JDKWQEVP.js").then(e=>e.PriceRoutingModule),canActivate:[p],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-3WGDHGSC.js").then(e=>e.OrdersModule),canActivate:[p],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-CAXMTBHH.js").then(e=>e.ReportModule),canActivate:[p],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-OQWLBQEH.js").then(e=>e.LogisticModule),canActivate:[p],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-26HKN7YV.js").then(e=>e.ChannelsModule),canActivate:[p],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-RX2NCNAM.js").then(e=>e.LogsModule),canActivate:[p],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-KGINCJJU.js").then(e=>e.NotificationModule),canActivate:[p],data:{title:"Push Notification"}}]}],Be=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({imports:[j.forChild(et),j]});let e=t;return e})();var Le=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({imports:[T,pe,Oe,ze,Te,Pe,ke,Se,S,Ee,we,be]});let e=t;return e})();var xi=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=u({type:t}),t.\u0275inj=h({providers:[se],imports:[T,Be,Ie,S,Le,Ne,he.forChild()]});let e=t;return e})();export{xi as MenuModule};
@@ -1,2 +1,2 @@
1
- import{a as ke}from"./chunk-J47B3BJQ.js";import{a as Ue}from"./chunk-6U6JR5K6.js";import{a as Fe}from"./chunk-MSVZKMTY.js";import{a as Ve,b as Ne}from"./chunk-2LGY3VGP.js";import{a as De,d as we,e as Pe}from"./chunk-S5GA4AVB.js";import{f as Le}from"./chunk-KWFES5F7.js";import{f as xe}from"./chunk-LBHJSQBZ.js";import{b as Te,e as ve}from"./chunk-DSF55IXM.js";import{b as D,c as w,i as P,j as E}from"./chunk-4R22UO7N.js";import{t as j}from"./chunk-MVPTQRFO.js";import{X as Ee}from"./chunk-EKCNJX26.js";import{b as Me,h as $,k as W,u as Oe}from"./chunk-B3LBEB32.js";import{b as p,c as v}from"./chunk-QPRFFPO5.js";import{$ as ce,$a as d,B as le,Bc as Se,Cb as he,Cc as be,Db as fe,Eb as ge,H as re,Ha as M,Hb as Y,Ia as s,Ib as c,Ja as g,Jb as S,K as se,Kb as O,Mb as k,Nb as V,Ob as N,Q as de,Qb as ue,Sb as Ce,T as q,V as H,Za as f,Zb as A,_a as Z,_b as B,ab as me,ac as J,c as z,ca as X,da as pe,ga as T,gb as ee,gd as Ie,lb as l,mb as r,n as ae,nb as b,oa as _,ob as F,pa as y,pb as U,q as K,rb as I,sc as _e,ub as u,uc as x,vc as R,wb as h,yc as ye,za as Q}from"./chunk-C3YE27TZ.js";function je(a,i){if(a&1&&(l(0,"mat-option",10)(1,"div",11),b(2,"img",12),l(3,"span"),c(4),r()()()),a&2){let n=i.$implicit;d("value",n.ID)("disabled",n.disabled),s(),d("matTooltip",n.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",n.Img,M),s(2),S(n.Name)}}function ze(a,i){if(a&1){let n=I();l(0,"div",13)(1,"label",14),c(2,"Scan Type"),r(),l(3,"mat-radio-group",15),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.ScanFull,e)||(o.filter.ScanFull=e),y(e)}),l(4,"mat-radio-button",16),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",17),c(7," Active "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Ge(a,i){a&1&&(l(0,"span"),c(1,"Never"),r())}function Ke(a,i){if(a&1&&(l(0,"span"),c(1),A(2,"async"),r()),a&2){let n=h(2);s(),S(B(2,1,n.lastSync$))}}function He(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3)(2,"span",18),c(3,"Last Scan:"),r(),f(4,Ge,2,0,"span"),A(5,"async"),f(6,Ke,3,3,"span"),r(),l(7,"mat-radio-group",19),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),y(e)}),l(8,"mat-radio-button",20),c(9," Scan All Products "),r(),l(10,"mat-radio-button",21),c(11),r()()()}if(a&2){let n=h();s(4),ee(B(5,6,n.lastSync$)==null?4:6),s(3),k("ngModel",n.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),O(" ",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Qe(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",22),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.Async,e)||(o.filter.Async=e),y(e)}),l(4,"mat-radio-button",23),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",24),c(7," Synchronous (Wait until Complete) "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var Mt=(()=>{let i=class i{constructor(t,e,o){this.dialogRef=t,this.data=e,this.router=o,this.channelService=pe(ke),this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:v.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=v.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=v.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(K(e=>v.IsNotEmpty(e.LastSync)?v.convertToReadableDate(e.LastSync):null),de(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&v.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return v.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};i.\u0275fac=function(e){return new(e||i)(g(D),g(w),g(Ie))},i.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(o.filter.ChannelID,C)||(o.filter.ChannelID=C),C}),u("ngModelChange",function(C){return o.onSelectChannel(C)}),f(7,je,5,5,"mat-option",6),r()(),f(8,ze,8,3,"div",7)(9,He,12,8,"div",8)(10,Qe,8,3,"div",9),r()()()),e&2&&(d("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),s(6),d("disabled",o.disabledChannelOption),k("ngModel",o.filter.ChannelID),s(),d("ngForOf",o.channelOptions),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),s(),ee(o.hasScanUpdate&&o.selectedChannel?9:-1),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[x,R,$,W,Ve,Ne,Le,Fe,Ee,j,E,ye],encapsulation:2});let a=i;return a})();var L=function(a){return a.Tokopedia="https://seller.tokopedia.com",a.Shoope="https://seller.shopee.co.id",a.Tiktok="https://seller-id.tiktok.com",a.WooCommerce="https://woocommerce.dealpos.app",a.Lazada="https://sellercenter.lazada.co.id",a}(L||{});var Ye=a=>({"is-disabled":a});function Je(a,i){if(a&1&&(F(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),U()),a&2){let n=h().$implicit;s(3),O(" ",n==null?null:n.Model,""),s(2),O(" ",n==null?null:n.Code,"")}}function qe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Model,"")}}function Xe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Code,"")}}function Ze(a,i){if(a&1&&(l(0,"tr"),f(1,qe,2,2,"td",14)(2,Xe,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),b(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),A(11,"number"),r(),l(12,"td",19),c(13),A(14,"number"),r(),l(15,"td",19)(16,"a",20),b(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),a&2){let n=i.$implicit,t=i.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",n.Url,M)("title",n.Title),s(),d("src",e.getChannelLogo(n.TypeID),M),s(),d("matTooltip",(n==null||n.Name==null?null:n.Name.length)>55?n==null?null:n.Name:""),s(),O(" ",n.Name," "),s(2),S(B(11,12,n.Price)),s(3),S(B(14,14,n.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(n),M)("ngClass",Ce(16,Ye,n.TypeID==e.channelType.KalCare))("matTooltip",n.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function et(a,i){if(a&1&&f(0,Ze,20,18,"tr",9),a&2){let n=h().$implicit;d("ngForOf",n==null?null:n.Channel)}}function tt(a,i){if(a&1&&(F(0),f(1,Je,9,2,"ng-container",10)(2,et,1,1,"ng-template",null,0,J),U()),a&2){let n=i.$implicit,t=Y(3);s(),d("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",t)}}var Vt=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return v.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),b(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),b(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),b(19,"th",5),r()(),l(20,"tbody"),f(21,tt,4,2,"ng-container",9),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[_e,x,R,j,E,Se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let a=i;return a})();var nt=["selectId"];function it(a,i){if(a&1&&(l(0,"span",3),c(1),r()),a&2){let n=i.item,t=h();d("title",n[t.bindLabel]),s(),S(n[t.bindLabel])}}var Re=(()=>{let i=class i{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 oe,this.selectedChange=new Q,this.selectedLabel=new Q,this.onOpen=new Q}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))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=T({type:i,selectors:[["ng-select-infinite"]],viewQuery:function(e,o){if(e&1&&he(nt,7),e&2){let m;fe(m=ge())&&(o.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[ue],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(e,o){if(e&1){let m=I();l(0,"ng-select",1,0),u("clear",function(){return _(m),y(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return _(m),y(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return _(m),y(o.onOpenSelect())})("change",function(We){return _(m),y(o.onSelectChange(We))}),f(2,it,2,2,"ng-template",2),r()}e&2&&(me("width",o.width),d("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[be,Pe,we,De,Oe,$,W]});let a=i;return a})(),oe=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new z,this._destroy$=new z,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(re(200),se(),K(i=>(i&&(i=i.toLowerCase()),this.filterData(i))),le(i=>i!==void 0),H(this._destroy$)).subscribe(i=>{this._dataBuffer=i.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(i){let n=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),n=t.indexOf(i),n!==-1||i==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(i){this._data=i||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(i,n){if(Ue.IsNotEmpty(i)){let t=this._data.filter(e=>e[n].toString().toLowerCase().indexOf(i)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(i){this._bufferSize=i}onScrollToEnd(){this.fetchMore()}fetchMore(){let i=this._dataBuffer.length,n=this._data.slice(i,this._bufferSize+i);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(n)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var $e=(()=>{let i=class i{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(q(o=>o!=null?ae(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(q(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};i.\u0275fac=function(e){return new(e||i)(X(xe),X(ve))},i.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();function lt(a,i){if(a&1){let n=I();F(0),l(1,"ng-select-infinite",16),u("selectedChange",function(e){_(n);let o=h().index,m=h();return y(m.onSelectCategory(e,o))}),r(),U()}if(a&2){let n=h().$implicit;s(),d("items",n.Categories)("clearable",!1)}}function rt(a,i){if(a&1&&(l(0,"div",17),b(1,"input",18),r()),a&2){let n=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==n.TypeID||t.channelType.Shopify==n.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(n.TypeID))}}function st(a,i){if(a&1){let n=I();F(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let o=_(n).$implicit;return V(o.Selected,e)||(o.Selected=e),y(e)}),u("ngModelChange",function(){_(n);let e=h();return y(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),b(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),f(10,lt,2,2,"ng-container",15)(11,rt,2,2,"ng-template",null,0,J),r()(),U()}if(a&2){let n=i.$implicit,t=Y(12);s(3),k("ngModel",n.Selected),s(3),d("src",n==null?null:n.Img,M)("alt",n.Name),s(2),S(n.Name),s(2),d("ngIf",n.Categories.length>0)("ngIfElse",t)}}var tn=(()=>{let i=class i{constructor(t,e,o,m){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new z,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,m)=>m.findIndex(C=>e.channelType==C.channelType)==o).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};i.\u0275fac=function(e){return new(e||i)(g(w),g($e),g(D),g(Te))},i.\u0275cmp=T({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),u("change",function(C){return o.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),f(14,st,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[x,R,Me,$,W,j,E,Re],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
1
+ import{a as ke}from"./chunk-J47B3BJQ.js";import{a as Ue}from"./chunk-6U6JR5K6.js";import{a as Fe}from"./chunk-MSVZKMTY.js";import{a as Ve,b as Ne}from"./chunk-2LGY3VGP.js";import{a as De,d as we,e as Pe}from"./chunk-S5GA4AVB.js";import{f as Le}from"./chunk-KWFES5F7.js";import{f as xe}from"./chunk-KGNFBVTF.js";import{b as Te,e as ve}from"./chunk-DSF55IXM.js";import{b as D,c as w,i as P,j as E}from"./chunk-4R22UO7N.js";import{t as j}from"./chunk-MVPTQRFO.js";import{X as Ee}from"./chunk-EKCNJX26.js";import{b as Me,h as $,k as W,u as Oe}from"./chunk-B3LBEB32.js";import{b as p,c as v}from"./chunk-QPRFFPO5.js";import{$ as ce,$a as d,B as le,Bc as Se,Cb as he,Cc as be,Db as fe,Eb as ge,H as re,Ha as M,Hb as Y,Ia as s,Ib as c,Ja as g,Jb as S,K as se,Kb as O,Mb as k,Nb as V,Ob as N,Q as de,Qb as ue,Sb as Ce,T as q,V as H,Za as f,Zb as A,_a as Z,_b as B,ab as me,ac as J,c as z,ca as X,da as pe,ga as T,gb as ee,gd as Ie,lb as l,mb as r,n as ae,nb as b,oa as _,ob as F,pa as y,pb as U,q as K,rb as I,sc as _e,ub as u,uc as x,vc as R,wb as h,yc as ye,za as Q}from"./chunk-C3YE27TZ.js";function je(a,i){if(a&1&&(l(0,"mat-option",10)(1,"div",11),b(2,"img",12),l(3,"span"),c(4),r()()()),a&2){let n=i.$implicit;d("value",n.ID)("disabled",n.disabled),s(),d("matTooltip",n.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",n.Img,M),s(2),S(n.Name)}}function ze(a,i){if(a&1){let n=I();l(0,"div",13)(1,"label",14),c(2,"Scan Type"),r(),l(3,"mat-radio-group",15),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.ScanFull,e)||(o.filter.ScanFull=e),y(e)}),l(4,"mat-radio-button",16),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",17),c(7," Active "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Ge(a,i){a&1&&(l(0,"span"),c(1,"Never"),r())}function Ke(a,i){if(a&1&&(l(0,"span"),c(1),A(2,"async"),r()),a&2){let n=h(2);s(),S(B(2,1,n.lastSync$))}}function He(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3)(2,"span",18),c(3,"Last Scan:"),r(),f(4,Ge,2,0,"span"),A(5,"async"),f(6,Ke,3,3,"span"),r(),l(7,"mat-radio-group",19),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),y(e)}),l(8,"mat-radio-button",20),c(9," Scan All Products "),r(),l(10,"mat-radio-button",21),c(11),r()()()}if(a&2){let n=h();s(4),ee(B(5,6,n.lastSync$)==null?4:6),s(3),k("ngModel",n.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),O(" ",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Qe(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",22),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.Async,e)||(o.filter.Async=e),y(e)}),l(4,"mat-radio-button",23),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",24),c(7," Synchronous (Wait until Complete) "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var Mt=(()=>{let i=class i{constructor(t,e,o){this.dialogRef=t,this.data=e,this.router=o,this.channelService=pe(ke),this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:v.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=v.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=v.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(K(e=>v.IsNotEmpty(e.LastSync)?v.convertToReadableDate(e.LastSync):null),de(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&v.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return v.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};i.\u0275fac=function(e){return new(e||i)(g(D),g(w),g(Ie))},i.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(o.filter.ChannelID,C)||(o.filter.ChannelID=C),C}),u("ngModelChange",function(C){return o.onSelectChannel(C)}),f(7,je,5,5,"mat-option",6),r()(),f(8,ze,8,3,"div",7)(9,He,12,8,"div",8)(10,Qe,8,3,"div",9),r()()()),e&2&&(d("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),s(6),d("disabled",o.disabledChannelOption),k("ngModel",o.filter.ChannelID),s(),d("ngForOf",o.channelOptions),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),s(),ee(o.hasScanUpdate&&o.selectedChannel?9:-1),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[x,R,$,W,Ve,Ne,Le,Fe,Ee,j,E,ye],encapsulation:2});let a=i;return a})();var L=function(a){return a.Tokopedia="https://seller.tokopedia.com",a.Shoope="https://seller.shopee.co.id",a.Tiktok="https://seller-id.tiktok.com",a.WooCommerce="https://woocommerce.dealpos.app",a.Lazada="https://sellercenter.lazada.co.id",a}(L||{});var Ye=a=>({"is-disabled":a});function Je(a,i){if(a&1&&(F(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),U()),a&2){let n=h().$implicit;s(3),O(" ",n==null?null:n.Model,""),s(2),O(" ",n==null?null:n.Code,"")}}function qe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Model,"")}}function Xe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Code,"")}}function Ze(a,i){if(a&1&&(l(0,"tr"),f(1,qe,2,2,"td",14)(2,Xe,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),b(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),A(11,"number"),r(),l(12,"td",19),c(13),A(14,"number"),r(),l(15,"td",19)(16,"a",20),b(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),a&2){let n=i.$implicit,t=i.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",n.Url,M)("title",n.Title),s(),d("src",e.getChannelLogo(n.TypeID),M),s(),d("matTooltip",(n==null||n.Name==null?null:n.Name.length)>55?n==null?null:n.Name:""),s(),O(" ",n.Name," "),s(2),S(B(11,12,n.Price)),s(3),S(B(14,14,n.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(n),M)("ngClass",Ce(16,Ye,n.TypeID==e.channelType.KalCare))("matTooltip",n.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function et(a,i){if(a&1&&f(0,Ze,20,18,"tr",9),a&2){let n=h().$implicit;d("ngForOf",n==null?null:n.Channel)}}function tt(a,i){if(a&1&&(F(0),f(1,Je,9,2,"ng-container",10)(2,et,1,1,"ng-template",null,0,J),U()),a&2){let n=i.$implicit,t=Y(3);s(),d("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",t)}}var Vt=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return v.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),b(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),b(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),b(19,"th",5),r()(),l(20,"tbody"),f(21,tt,4,2,"ng-container",9),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[_e,x,R,j,E,Se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let a=i;return a})();var nt=["selectId"];function it(a,i){if(a&1&&(l(0,"span",3),c(1),r()),a&2){let n=i.item,t=h();d("title",n[t.bindLabel]),s(),S(n[t.bindLabel])}}var Re=(()=>{let i=class i{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 oe,this.selectedChange=new Q,this.selectedLabel=new Q,this.onOpen=new Q}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))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=T({type:i,selectors:[["ng-select-infinite"]],viewQuery:function(e,o){if(e&1&&he(nt,7),e&2){let m;fe(m=ge())&&(o.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[ue],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(e,o){if(e&1){let m=I();l(0,"ng-select",1,0),u("clear",function(){return _(m),y(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return _(m),y(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return _(m),y(o.onOpenSelect())})("change",function(We){return _(m),y(o.onSelectChange(We))}),f(2,it,2,2,"ng-template",2),r()}e&2&&(me("width",o.width),d("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[be,Pe,we,De,Oe,$,W]});let a=i;return a})(),oe=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new z,this._destroy$=new z,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(re(200),se(),K(i=>(i&&(i=i.toLowerCase()),this.filterData(i))),le(i=>i!==void 0),H(this._destroy$)).subscribe(i=>{this._dataBuffer=i.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(i){let n=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),n=t.indexOf(i),n!==-1||i==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(i){this._data=i||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(i,n){if(Ue.IsNotEmpty(i)){let t=this._data.filter(e=>e[n].toString().toLowerCase().indexOf(i)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(i){this._bufferSize=i}onScrollToEnd(){this.fetchMore()}fetchMore(){let i=this._dataBuffer.length,n=this._data.slice(i,this._bufferSize+i);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(n)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var $e=(()=>{let i=class i{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(q(o=>o!=null?ae(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(q(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};i.\u0275fac=function(e){return new(e||i)(X(xe),X(ve))},i.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();function lt(a,i){if(a&1){let n=I();F(0),l(1,"ng-select-infinite",16),u("selectedChange",function(e){_(n);let o=h().index,m=h();return y(m.onSelectCategory(e,o))}),r(),U()}if(a&2){let n=h().$implicit;s(),d("items",n.Categories)("clearable",!1)}}function rt(a,i){if(a&1&&(l(0,"div",17),b(1,"input",18),r()),a&2){let n=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==n.TypeID||t.channelType.Shopify==n.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(n.TypeID))}}function st(a,i){if(a&1){let n=I();F(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let o=_(n).$implicit;return V(o.Selected,e)||(o.Selected=e),y(e)}),u("ngModelChange",function(){_(n);let e=h();return y(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),b(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),f(10,lt,2,2,"ng-container",15)(11,rt,2,2,"ng-template",null,0,J),r()(),U()}if(a&2){let n=i.$implicit,t=Y(12);s(3),k("ngModel",n.Selected),s(3),d("src",n==null?null:n.Img,M)("alt",n.Name),s(2),S(n.Name),s(2),d("ngIf",n.Categories.length>0)("ngIfElse",t)}}var tn=(()=>{let i=class i{constructor(t,e,o,m){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new z,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,m)=>m.findIndex(C=>e.channelType==C.channelType)==o).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};i.\u0275fac=function(e){return new(e||i)(g(w),g($e),g(D),g(Te))},i.\u0275cmp=T({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),u("change",function(C){return o.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),f(14,st,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[x,R,Me,$,W,j,E,Re],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
2
2
  `],encapsulation:2});let a=i;return a})();function dt(a,i){if(a&1&&(l(0,"tr")(1,"td"),c(2),r(),l(3,"td"),c(4),r()()),a&2){let n=i.$implicit;s(2),S(n==null?null:n.Name),s(2),S(n==null?null:n.ChannelVariationSKU)}}var ln=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],[4,"ngFor","ngForOf"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6,"Variant"),r(),l(7,"th",4),c(8,"SKU"),r()()(),l(9,"tbody"),f(10,dt,5,2,"tr",5),r()()()()),e&2&&(d("config",o.modalConfig),s(10),d("ngForOf",o.data.variants))},dependencies:[x,E],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let a=i;return a})();export{Mt as a,Vt as b,Re as c,tn as d,ln as e};
@@ -1 +1 @@
1
- import{a as ve}from"./chunk-IWVYX6KY.js";import{a as Me}from"./chunk-V6L3NRY3.js";import{a as ye,b as Ie,c as we}from"./chunk-2LGY3VGP.js";import"./chunk-MOFF6ASU.js";import{a as Oe}from"./chunk-VOWLO2M7.js";import{a as K}from"./chunk-BSBYMQ7J.js";import{a as De,b as X,c as Ve}from"./chunk-L34D7YAZ.js";import"./chunk-YG3KQ63T.js";import{a as he}from"./chunk-662E5VTA.js";import{a as Fe,c as Ee}from"./chunk-5WXM6HSA.js";import"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Te}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as xe}from"./chunk-LBHJSQBZ.js";import{b as _e,e as ue}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Pe,l as be,m as Se}from"./chunk-4R22UO7N.js";import{t as j,u as W}from"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as ge,h as L,k as U,u as A}from"./chunk-B3LBEB32.js";import{c as J,e as Ce,f as fe}from"./chunk-QPRFFPO5.js";import{$a as s,$b as ce,B as G,Bc as de,Cc as $,Ha as T,Hb as z,Ia as l,Ib as p,Ja as S,Jb as oe,Kb as P,Lb as re,Mb as V,Nb as N,Ob as k,Pb as ae,Q as Y,Qb as B,Sb as F,Tb as le,X as q,Za as g,Zb as b,_b as w,ac as H,cb as te,da as Q,ga as D,gb as ne,hb as E,jb as M,kb as O,lb as a,mb as c,nb as x,oa as C,ob as v,pa as f,pb as y,q as Z,rb as I,sc as se,ub as h,uc as R,vc as me,wb as m,yc as pe,za as ee,zb as ie}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var Ue=(t,r)=>({color:t,"font-weight":r});function Ae(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(le(7,Ue,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),P("",i.Value," ")}}var Ne=(()=>{let r=class r{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,Ae,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,we,ye,Ie,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let t=r;return t})();var ke=t=>[t],je=t=>({"text-decoration-line-through":t}),We=t=>({"border-bottom":t}),Ke=t=>({"bg-gradient-warning":t});function Ge(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function ze(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),x(1,"i",26),p(2," Update "),c()}}function He(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,ze,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Je(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),x(2,"img",28),a(3,"div",29),p(4),b(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),re(" ",ce(5,4,i.Name,20),"",(i.Name==null?null:i.Name.length)>20?"...":""," ")}}function Xe(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function Ze(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function qe(t,r){t&1&&x(0,"img",46)}function Qe(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),P("(",i==null?null:i.Category,")")}}function et(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,Qe,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,We,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function tt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function nt(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),b(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),b(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),x(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),P(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ke,i.Price!=i.PriceExpected)),l(3),P(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function it(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function ot(t,r){if(t&1&&(v(0),g(1,nt,11,10,"ng-container",48)(2,it,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function rt(t,r){if(t&1&&(a(0,"tr"),g(1,et,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),x(10,"i",38),c()()()(),g(11,tt,2,1,"ng-template",19)(12,ot,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),P(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,je,i.Discontinued)),l(),P(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function at(t,r){if(t&1&&(a(0,"tbody"),M(1,rt,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function lt(t,r){if(t&1&&(v(0),M(1,at,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Jt=(()=>{let r=class r{constructor(o,e,n,d,_,u){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.infinitePagination=Q(X),this.searchFilter=new ve,this.checkboxState=!1,this.rolePriceEdit=he.price,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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(Y(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(q(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.Price}`,"Success")})}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(S(ue),S(_e),S(Pe),S(Fe),S(xe),S(Te))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[ae([X]),B],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[2,"height","46px"],[1,"mb-3"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,Ge,5,2,"ng-container",3),b(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,He,3,1,"ng-container",3),b(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),x(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),x(20,"th",14),M(21,Je,6,7,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Xe,2,1,"ng-template",19),M(32,Ze,7,0,null,null,E),c()(),g(34,lt,3,0,"ng-container",3),b(35,"async"),c(),a(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,se,R,me,pe,de,Se,be,A,ge,L,U,Ve,Ne,W,j,Ee,fe,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let t=r;return t})();export{Jt as CustomChannelPriceComponent};
1
+ import{a as ve}from"./chunk-IWVYX6KY.js";import{a as Me}from"./chunk-V6L3NRY3.js";import{a as ye,b as Ie,c as we}from"./chunk-2LGY3VGP.js";import"./chunk-57XFPFTU.js";import{a as Oe}from"./chunk-VOWLO2M7.js";import{a as K}from"./chunk-BSBYMQ7J.js";import{a as De,b as X,c as Ve}from"./chunk-L34D7YAZ.js";import"./chunk-YG3KQ63T.js";import{a as he}from"./chunk-662E5VTA.js";import{a as Fe,c as Ee}from"./chunk-5WXM6HSA.js";import"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Te}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as xe}from"./chunk-KGNFBVTF.js";import{b as _e,e as ue}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Pe,l as be,m as Se}from"./chunk-4R22UO7N.js";import{t as j,u as W}from"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as ge,h as L,k as U,u as A}from"./chunk-B3LBEB32.js";import{c as J,e as Ce,f as fe}from"./chunk-QPRFFPO5.js";import{$a as s,$b as ce,B as G,Bc as de,Cc as $,Ha as T,Hb as z,Ia as l,Ib as p,Ja as S,Jb as oe,Kb as P,Lb as re,Mb as V,Nb as N,Ob as k,Pb as ae,Q as Y,Qb as B,Sb as F,Tb as le,X as q,Za as g,Zb as b,_b as w,ac as H,cb as te,da as Q,ga as D,gb as ne,hb as E,jb as M,kb as O,lb as a,mb as c,nb as x,oa as C,ob as v,pa as f,pb as y,q as Z,rb as I,sc as se,ub as h,uc as R,vc as me,wb as m,yc as pe,za as ee,zb as ie}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var Ue=(t,r)=>({color:t,"font-weight":r});function Ae(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(le(7,Ue,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),P("",i.Value," ")}}var Ne=(()=>{let r=class r{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,Ae,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,we,ye,Ie,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let t=r;return t})();var ke=t=>[t],je=t=>({"text-decoration-line-through":t}),We=t=>({"border-bottom":t}),Ke=t=>({"bg-gradient-warning":t});function Ge(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function ze(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),x(1,"i",26),p(2," Update "),c()}}function He(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,ze,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Je(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),x(2,"img",28),a(3,"div",29),p(4),b(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),re(" ",ce(5,4,i.Name,20),"",(i.Name==null?null:i.Name.length)>20?"...":""," ")}}function Xe(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function Ze(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function qe(t,r){t&1&&x(0,"img",46)}function Qe(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),P("(",i==null?null:i.Category,")")}}function et(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,Qe,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,We,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function tt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function nt(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),b(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),b(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),x(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),P(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ke,i.Price!=i.PriceExpected)),l(3),P(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function it(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function ot(t,r){if(t&1&&(v(0),g(1,nt,11,10,"ng-container",48)(2,it,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function rt(t,r){if(t&1&&(a(0,"tr"),g(1,et,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),x(10,"i",38),c()()()(),g(11,tt,2,1,"ng-template",19)(12,ot,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),P(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,je,i.Discontinued)),l(),P(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function at(t,r){if(t&1&&(a(0,"tbody"),M(1,rt,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function lt(t,r){if(t&1&&(v(0),M(1,at,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Jt=(()=>{let r=class r{constructor(o,e,n,d,_,u){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.infinitePagination=Q(X),this.searchFilter=new ve,this.checkboxState=!1,this.rolePriceEdit=he.price,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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(Y(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(q(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.Price}`,"Success")})}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(S(ue),S(_e),S(Pe),S(Fe),S(xe),S(Te))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[ae([X]),B],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[2,"height","46px"],[1,"mb-3"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,Ge,5,2,"ng-container",3),b(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,He,3,1,"ng-container",3),b(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),x(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),x(20,"th",14),M(21,Je,6,7,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Xe,2,1,"ng-template",19),M(32,Ze,7,0,null,null,E),c()(),g(34,lt,3,0,"ng-container",3),b(35,"async"),c(),a(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,se,R,me,pe,de,Se,be,A,ge,L,U,Ve,Ne,W,j,Ee,fe,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let t=r;return t})();export{Jt as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as v,b}from"./chunk-PIIJRFHM.js";import{a as r}from"./chunk-U7BIKZZA.js";import"./chunk-LBHJSQBZ.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import"./chunk-QPRFFPO5.js";import{$a as u,Cc as o,Ia as s,Qb as f,aa as l,fd as h,ga as m,ha as c,jd as i,lb as d,mb as C,nb as a}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-FTV52HXX.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-ZPUPB7UU.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-5DAS2XHT.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
1
+ import{a as v,b}from"./chunk-PIIJRFHM.js";import{a as r}from"./chunk-UHE3QQB5.js";import"./chunk-KGNFBVTF.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import"./chunk-QPRFFPO5.js";import{$a as u,Cc as o,Ia as s,Qb as f,aa as l,fd as h,ga as m,ha as c,jd as i,lb as d,mb as C,nb as a}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-VOSKUYZN.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-HWUMVID7.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-JWI6NSSG.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
@@ -1 +1 @@
1
- import{a as N}from"./chunk-2YXHLXID.js";import{a as Ee}from"./chunk-V6L3NRY3.js";import{a as xe,b as fe,d as Pe,e as Se}from"./chunk-S5GA4AVB.js";import{a as M}from"./chunk-BSBYMQ7J.js";import{a as Me,b as U,c as Ne}from"./chunk-L34D7YAZ.js";import{a as ge}from"./chunk-662E5VTA.js";import{a as be,c as De}from"./chunk-5WXM6HSA.js";import{a as Ve,b as Te}from"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Fe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as ue}from"./chunk-LBHJSQBZ.js";import{b as oe,e as re}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Ie,k as ye,l as we,m as ve}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as le,c as ce,h as se,k as _e,m as pe,u as me}from"./chunk-B3LBEB32.js";import{c as de,e as he,f as Ce}from"./chunk-QPRFFPO5.js";import{$a as _,$b as Y,B as A,Bc as E,Cc as ae,Ha as T,Hb as J,Ia as l,Ib as d,Ja as f,Jb as B,Kb as D,Lb as Z,Mb as I,Nb as y,Ob as w,Pb as Q,Q as $,Qb as X,Sb as F,X as j,Za as h,Zb as v,_b as V,ac as ee,da as z,ga as G,gb as P,hb as k,jb as R,kb as L,lb as o,mb as c,nb as S,oa as p,ob as K,pa as m,pb as q,rb as x,sc as te,ub as u,vc as ne,wb as r,yc as ie,zb as H}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(o(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),_("src",t==null?null:t.Img,T),l(),D(" ",t.Name," ")}}function We(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){p(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),S(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),o(3,"button",14),u("click",function(){p(t);let n=r(2);return m(n.openExportDialog())}),S(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),_("ngIf",e.productService.hasSelectionVariant(t))}}function $e(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){p(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function je(i,s){if(i&1){let t=x();o(0,"input",51),w("ngModelChange",function(n){p(t);let a=r(4).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){p(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let t=r(6);_("ngxPermissionsOnly",F(1,O,t.rolePriceEdit))}}function Ge(i,s){if(i&1){let t=x();K(0),o(1,"img",52),u("click",function(n){p(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),q()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,T)}}function Ke(i,s){i&1&&S(0,"img",53)}function qe(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),D("(",t.Category,")")}}function He(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),o(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,Ke,1,0,"ng-template",null,0,ee),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,qe,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;_("rowSpan",e.Variants.length),l(2),P((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),_("ngClass",F(8,Ue,(e.Variants==null?null:e.Variants.length)<=1)),l(),_("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),_("rowSpan",e.Variants.length),l(2),B(e.Name),l(),P(e.Category?10:-1)}}function Je(i,s){if(i&1){let t=x();o(0,"input",56),w("ngModelChange",function(n){p(t);let a=r(2).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Ze(i,s){if(i&1&&(o(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),P(t.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),D(" ",V(2,1,t.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),S(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),_("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),T)}}function et(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){p(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),D(" ",V(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,He,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),o(16,"div",37)(17,"a",40),S(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=p(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),S(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),P(e==0?1:-1),l(2),B(t.Model),l(2),_("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",F(12,Le,t.Discontinued)),l(),D(" ",t.Code," "),l(),_("ngxPermissionsOnly",F(14,O,n.rolePriceEdit)),l(3),P((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),P((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),P((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),_("ngClass",F(16,Be,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),P(t.Channel.length>0?15:-1),l(2),_("href",t.Channel[0]==null?null:t.Channel[0].Url,T)}}function nt(i,s){if(i&1&&R(0,tt,22,18,"tr",33,k),i&2){let t=s.$implicit;L(t.Variants)}}function it(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),w("ngModelChange",function(n){p(t);let a=r(2);return y(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){p(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){p(t);let n=r(2);return m(n.openModalFilter())}),S(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),R(26,nt,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),_("ngxPermissionsOnly",F(17,O,e.rolePriceEdit)),l(4),_("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),_("src",e.selectedChannel==null?null:e.selectedChannel.Img,T),l(2),Z(" ",Y(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),L(t),l(2),_("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",V(29,15,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function at(i,s){if(i&1){let t=x();o(0,"mainpanel",2),w("textChange",function(n){p(t);let a=r();return y(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){p(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Oe,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,19,"content",9),v(18,"async"),c()}if(i&2){let t=r();_("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),_("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),_("ngIf",V(16,9,t.data$)),l(2),_("ngIf",V(18,11,t.data$))}}var Wt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,ke,Re){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=ke,this.decimalPipe=Re,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ge.price,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($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,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(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Me,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>de.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={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",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ee,{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()}};s.\u0275fac=function(n){return new(n||s)(f(re),f(oe),f(Ie),f(be),f(Fe),f(N),f(ue),f(ye),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Q([U,N,E]),X],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-lg","fa-external-link-alt"],["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"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[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","20px",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","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,at,19,13,"mainpanel",1),v(1,"async")),n&2&&_("ngIf",V(1,1,a.loader$))},dependencies:[ae,te,ne,ie,E,ve,we,Se,Pe,xe,fe,me,ce,pe,le,se,_e,De,Ne,Ce,he,Te,Ve],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});let i=s;return i})();export{Wt as PriceSingleChannelComponent};
1
+ import{a as N}from"./chunk-2YXHLXID.js";import{a as Ee}from"./chunk-V6L3NRY3.js";import{a as xe,b as fe,d as Pe,e as Se}from"./chunk-S5GA4AVB.js";import{a as M}from"./chunk-BSBYMQ7J.js";import{a as Me,b as U,c as Ne}from"./chunk-L34D7YAZ.js";import{a as ge}from"./chunk-662E5VTA.js";import{a as be,c as De}from"./chunk-5WXM6HSA.js";import{a as Ve,b as Te}from"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Fe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as ue}from"./chunk-KGNFBVTF.js";import{b as oe,e as re}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Ie,k as ye,l as we,m as ve}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as le,c as ce,h as se,k as _e,m as pe,u as me}from"./chunk-B3LBEB32.js";import{c as de,e as he,f as Ce}from"./chunk-QPRFFPO5.js";import{$a as _,$b as Y,B as A,Bc as E,Cc as ae,Ha as T,Hb as J,Ia as l,Ib as d,Ja as f,Jb as B,Kb as D,Lb as Z,Mb as I,Nb as y,Ob as w,Pb as Q,Q as $,Qb as X,Sb as F,X as j,Za as h,Zb as v,_b as V,ac as ee,da as z,ga as G,gb as P,hb as k,jb as R,kb as L,lb as o,mb as c,nb as S,oa as p,ob as K,pa as m,pb as q,rb as x,sc as te,ub as u,vc as ne,wb as r,yc as ie,zb as H}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(o(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),_("src",t==null?null:t.Img,T),l(),D(" ",t.Name," ")}}function We(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){p(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),S(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),o(3,"button",14),u("click",function(){p(t);let n=r(2);return m(n.openExportDialog())}),S(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),_("ngIf",e.productService.hasSelectionVariant(t))}}function $e(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){p(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function je(i,s){if(i&1){let t=x();o(0,"input",51),w("ngModelChange",function(n){p(t);let a=r(4).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){p(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let t=r(6);_("ngxPermissionsOnly",F(1,O,t.rolePriceEdit))}}function Ge(i,s){if(i&1){let t=x();K(0),o(1,"img",52),u("click",function(n){p(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),q()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,T)}}function Ke(i,s){i&1&&S(0,"img",53)}function qe(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),D("(",t.Category,")")}}function He(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),o(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,Ke,1,0,"ng-template",null,0,ee),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,qe,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;_("rowSpan",e.Variants.length),l(2),P((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),_("ngClass",F(8,Ue,(e.Variants==null?null:e.Variants.length)<=1)),l(),_("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),_("rowSpan",e.Variants.length),l(2),B(e.Name),l(),P(e.Category?10:-1)}}function Je(i,s){if(i&1){let t=x();o(0,"input",56),w("ngModelChange",function(n){p(t);let a=r(2).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Ze(i,s){if(i&1&&(o(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),P(t.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),D(" ",V(2,1,t.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),S(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),_("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),T)}}function et(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){p(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),D(" ",V(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,He,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),o(16,"div",37)(17,"a",40),S(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=p(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),S(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),P(e==0?1:-1),l(2),B(t.Model),l(2),_("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",F(12,Le,t.Discontinued)),l(),D(" ",t.Code," "),l(),_("ngxPermissionsOnly",F(14,O,n.rolePriceEdit)),l(3),P((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),P((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),P((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),_("ngClass",F(16,Be,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),P(t.Channel.length>0?15:-1),l(2),_("href",t.Channel[0]==null?null:t.Channel[0].Url,T)}}function nt(i,s){if(i&1&&R(0,tt,22,18,"tr",33,k),i&2){let t=s.$implicit;L(t.Variants)}}function it(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),w("ngModelChange",function(n){p(t);let a=r(2);return y(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){p(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){p(t);let n=r(2);return m(n.openModalFilter())}),S(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),R(26,nt,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),_("ngxPermissionsOnly",F(17,O,e.rolePriceEdit)),l(4),_("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),_("src",e.selectedChannel==null?null:e.selectedChannel.Img,T),l(2),Z(" ",Y(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),L(t),l(2),_("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",V(29,15,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function at(i,s){if(i&1){let t=x();o(0,"mainpanel",2),w("textChange",function(n){p(t);let a=r();return y(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){p(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Oe,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,19,"content",9),v(18,"async"),c()}if(i&2){let t=r();_("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),_("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),_("ngIf",V(16,9,t.data$)),l(2),_("ngIf",V(18,11,t.data$))}}var Wt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,ke,Re){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=ke,this.decimalPipe=Re,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ge.price,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($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,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(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Me,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>de.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={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",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ee,{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()}};s.\u0275fac=function(n){return new(n||s)(f(re),f(oe),f(Ie),f(be),f(Fe),f(N),f(ue),f(ye),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Q([U,N,E]),X],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-lg","fa-external-link-alt"],["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"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[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","20px",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","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,at,19,13,"mainpanel",1),v(1,"async")),n&2&&_("ngIf",V(1,1,a.loader$))},dependencies:[ae,te,ne,ie,E,ve,we,Se,Pe,xe,fe,me,ce,pe,le,se,_e,De,Ne,Ce,he,Te,Ve],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});let i=s;return i})();export{Wt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as B}from"./chunk-F6UMOF3O.js";import{a as vt}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-YZ42FKNJ.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-S5GA4AVB.js";import{g as dt}from"./chunk-LBHJSQBZ.js";import{e as at}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{l as k,m as ht}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{h as lt,k as mt,u as ct}from"./chunk-B3LBEB32.js";import{c as pt}from"./chunk-QPRFFPO5.js";import{$a as p,$b as S,Bc as P,Cc as L,Ga as W,Ha as H,Hb as K,Ia as m,Ib as l,Ja as v,Jb as d,Kb as x,Mb as Q,Nb as X,Ob as Y,Q as j,Rb as Z,Sb as tt,T as q,Tb as et,V as U,Za as u,Zb as s,_b as _,aa as I,ac as it,c as z,ed as rt,ga as y,ha as b,hd as F,jd as R,lb as r,mb as o,nb as D,oa as N,ob as g,pa as E,pb as h,q as C,rb as G,sc as nt,ub as V,uc as ot,vc as T,wb as f,yc as w,zb as J,zc as M}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=pt.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,lt,mt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(rt),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,ct,ht,R,$]});let t=e;return t})();export{se as NotificationModule};
1
+ import{a as B}from"./chunk-FELGHSYN.js";import{a as vt}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-YZ42FKNJ.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-S5GA4AVB.js";import{g as dt}from"./chunk-KGNFBVTF.js";import{e as at}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{l as k,m as ht}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{h as lt,k as mt,u as ct}from"./chunk-B3LBEB32.js";import{c as pt}from"./chunk-QPRFFPO5.js";import{$a as p,$b as S,Bc as P,Cc as L,Ga as W,Ha as H,Hb as K,Ia as m,Ib as l,Ja as v,Jb as d,Kb as x,Mb as Q,Nb as X,Ob as Y,Q as j,Rb as Z,Sb as tt,T as q,Tb as et,V as U,Za as u,Zb as s,_b as _,aa as I,ac as it,c as z,ed as rt,ga as y,ha as b,hd as F,jd as R,lb as r,mb as o,nb as D,oa as N,ob as g,pa as E,pb as h,q as C,rb as G,sc as nt,ub as V,uc as ot,vc as T,wb as f,yc as w,zb as J,zc as M}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=pt.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,lt,mt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(rt),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,ct,ht,R,$]});let t=e;return t})();export{se as NotificationModule};