marketplacepos 5.37.2 → 5.37.3

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 (35) hide show
  1. package/Marketplace/{chunk-ZCGHEDGV.js → chunk-2GZHR5B6.js} +1 -1
  2. package/Marketplace/{chunk-UI3RKKVM.js → chunk-2UTIQYD5.js} +1 -1
  3. package/Marketplace/{chunk-F6Y7LJ64.js → chunk-37E3M43E.js} +1 -1
  4. package/Marketplace/{chunk-XJIHUZS4.js → chunk-4LFDWANC.js} +1 -1
  5. package/Marketplace/{chunk-MV2W43TI.js → chunk-4RQOSK5F.js} +1 -1
  6. package/Marketplace/{chunk-S4D2PHBV.js → chunk-5CFZVTQ4.js} +1 -1
  7. package/Marketplace/{chunk-QP6X3QVC.js → chunk-5H7VJWTS.js} +1 -1
  8. package/Marketplace/{chunk-MNMVQQPT.js → chunk-5JXFTD66.js} +1 -1
  9. package/Marketplace/{chunk-2H7UKR4Z.js → chunk-5Z2DV3KI.js} +1 -1
  10. package/Marketplace/{chunk-C4ESA6DM.js → chunk-6TWOK2UE.js} +1 -1
  11. package/Marketplace/{chunk-KEFQSTJD.js → chunk-6XMCVQHO.js} +1 -1
  12. package/Marketplace/{chunk-TR23CMVW.js → chunk-CP2JRSBP.js} +1 -1
  13. package/Marketplace/{chunk-77ESDFMO.js → chunk-CPWY5NNP.js} +2 -2
  14. package/Marketplace/{chunk-HETMK7WT.js → chunk-DLJM5DIT.js} +1 -1
  15. package/Marketplace/{chunk-BTPFPDPR.js → chunk-F7MJGS4G.js} +1 -1
  16. package/Marketplace/{chunk-4EWARO65.js → chunk-GRIDVGCK.js} +1 -1
  17. package/Marketplace/{chunk-K7LGJFCY.js → chunk-I7QHQH2B.js} +2 -2
  18. package/Marketplace/{chunk-GG2SCXTS.js → chunk-IIUO6LMB.js} +1 -1
  19. package/Marketplace/{chunk-JGKNWNHJ.js → chunk-KDWRJAZ3.js} +1 -1
  20. package/Marketplace/{chunk-CAGSG3DY.js → chunk-M4L72LVB.js} +1 -1
  21. package/Marketplace/{chunk-AVSGKP57.js → chunk-NDI26IPP.js} +1 -1
  22. package/Marketplace/{chunk-3YRPTVAF.js → chunk-NE4TB7EL.js} +1 -1
  23. package/Marketplace/{chunk-KC2FFVLF.js → chunk-NTEU4OOR.js} +1 -1
  24. package/Marketplace/{chunk-KSJLJ53O.js → chunk-PCRUNEHK.js} +1 -1
  25. package/Marketplace/{chunk-CIKNTHCR.js → chunk-PRTTKQS3.js} +1 -1
  26. package/Marketplace/{chunk-ZHKZ3QZP.js → chunk-Q7GZOMHZ.js} +1 -1
  27. package/Marketplace/{chunk-S45YFO7W.js → chunk-QPNKMUHW.js} +1 -1
  28. package/Marketplace/{chunk-JJFRUJBP.js → chunk-RRUJDNMA.js} +1 -1
  29. package/Marketplace/{chunk-D7G7GVNH.js → chunk-TAOZITLN.js} +1 -1
  30. package/Marketplace/{chunk-R4FFSLZS.js → chunk-TRGSTYXO.js} +1 -1
  31. package/Marketplace/{chunk-64V4L3IJ.js → chunk-UKPQ245L.js} +1 -1
  32. package/Marketplace/{chunk-TNQMLUO7.js → chunk-XRKIKLQG.js} +1 -1
  33. package/Marketplace/index.html +2 -2
  34. package/Marketplace/{main-TSXSJ6BP.js → main-WT7IQ6WY.js} +1 -1
  35. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- import{e as te}from"./chunk-JSPVOV7M.js";import{a as $e,b as ge,c as ze,d as Ke,e as me,f as Ge,g as Se,h as Ve,i as q,j as Ae,k as y}from"./chunk-V5WYSCVT.js";import{b as fe,c as ee,d as Je}from"./chunk-W6T7TOHE.js";import{G as He,L as qe,n as Fe,o as Ue,p as We}from"./chunk-B6POIFQM.js";import{$c as Be,F as je,Fb as W,G as Oe,La as F,O as ue,T as Ne,Va as U,Z as de,aa as _,ad as Le,ba as he,c as g,ea as G,ed as V,f as Y,j as Re,ja as k,k as _e,ka as B,ma as T,n as z,o as Q,oa as h,p as x,pa as L,q as K,qa as Me,ua as pe,v as D,w as xe}from"./chunk-EIQCOZF5.js";import{a as le,i as b}from"./chunk-K2H6WANG.js";var Ze={production:!0,version:"5.37.2",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var At="firebase",vt="11.10.0";q(At,vt,"app");var H=new Be("ANGULARFIRE2_VERSION");var Xe=(t,a)=>{let e=a?[a]:Ve(),n=[];return e.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{n.includes(i)||n.push(i)})}),n},ve=function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t}(ve||{}),Pn=V()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var ne=class{zone;delegate;constructor(a,e=_e){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,n){let r=this.zone,o=function(i){r?r.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,n)}},we=(()=>{class t{outsideAngular;insideAngular;constructor(){let e=L(F);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,Re))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var kt=new Map,It={activated:!1,tokenObservers:[]},bt={initialized:!1,enabled:!1};function C(t){return kt.get(t)||Object.assign({},It)}function tt(){return bt}var Tt="https://content-firebaseappcheck.googleapis.com/v1";var Et="exchangeDebugToken",Ye={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Fn=24*60*60*1e3;var be=class{constructor(a,e,n,r,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return b(this,null,function*(){this.stop();try{this.pending=new ge,this.pending.promise.catch(e=>{}),yield yt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new ge,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function yt(t){return new Promise(a=>{setTimeout(a,t)})}var Ct={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},O=new Ke("appCheck","AppCheck",Ct);function nt(t){if(!C(t).activated)throw O.create("use-before-activation",{appName:t.name})}function rt(n,r){return b(this,arguments,function*({url:t,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let s={method:"POST",body:JSON.stringify(a),headers:o},l;try{l=yield fetch(t,s)}catch(f){throw O.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw O.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw O.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw O.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ot(t,a){let{projectId:e,appId:n,apiKey:r}=t.options;return{url:`${Tt}/projects/${e}/apps/${n}:${Et}?key=${r}`,body:{debug_token:a}}}var Pt="firebase-app-check-database",Dt=1,Te="firebase-app-check-store";var re=null;function Rt(){return re||(re=new Promise((t,a)=>{try{let e=indexedDB.open(Pt,Dt);e.onsuccess=n=>{t(n.target.result)},e.onerror=n=>{var r;a(O.create("storage-open",{originalErrorMessage:(r=n.target.error)===null||r===void 0?void 0:r.message}))},e.onupgradeneeded=n=>{let r=n.target.result;switch(n.oldVersion){case 0:r.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){a(O.create("storage-open",{originalErrorMessage:e?.message}))}}),re)}function _t(t,a){return xt(jt(t),a)}function xt(t,a){return b(this,null,function*(){let n=(yield Rt()).transaction(Te,"readwrite"),o=n.objectStore(Te).put({compositeKey:t,value:a});return new Promise((i,s)=>{o.onsuccess=l=>{i()},n.onerror=l=>{var c;s(O.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function jt(t){return`${t.options.appId}-${t.name}`}var J=new Ge("@firebase/app-check");function ke(t,a){return ze()?_t(t,a).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function it(){return tt().enabled}function at(){return b(this,null,function*(){let t=tt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
1
+ import{e as te}from"./chunk-JSPVOV7M.js";import{a as $e,b as ge,c as ze,d as Ke,e as me,f as Ge,g as Se,h as Ve,i as q,j as Ae,k as y}from"./chunk-V5WYSCVT.js";import{b as fe,c as ee,d as Je}from"./chunk-W6T7TOHE.js";import{G as He,L as qe,n as Fe,o as Ue,p as We}from"./chunk-B6POIFQM.js";import{$c as Be,F as je,Fb as W,G as Oe,La as F,O as ue,T as Ne,Va as U,Z as de,aa as _,ad as Le,ba as he,c as g,ea as G,ed as V,f as Y,j as Re,ja as k,k as _e,ka as B,ma as T,n as z,o as Q,oa as h,p as x,pa as L,q as K,qa as Me,ua as pe,v as D,w as xe}from"./chunk-EIQCOZF5.js";import{a as le,i as b}from"./chunk-K2H6WANG.js";var Ze={production:!0,version:"5.37.3",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var At="firebase",vt="11.10.0";q(At,vt,"app");var H=new Be("ANGULARFIRE2_VERSION");var Xe=(t,a)=>{let e=a?[a]:Ve(),n=[];return e.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{n.includes(i)||n.push(i)})}),n},ve=function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t}(ve||{}),Pn=V()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var ne=class{zone;delegate;constructor(a,e=_e){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,n){let r=this.zone,o=function(i){r?r.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,n)}},we=(()=>{class t{outsideAngular;insideAngular;constructor(){let e=L(F);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,Re))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var kt=new Map,It={activated:!1,tokenObservers:[]},bt={initialized:!1,enabled:!1};function C(t){return kt.get(t)||Object.assign({},It)}function tt(){return bt}var Tt="https://content-firebaseappcheck.googleapis.com/v1";var Et="exchangeDebugToken",Ye={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Fn=24*60*60*1e3;var be=class{constructor(a,e,n,r,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return b(this,null,function*(){this.stop();try{this.pending=new ge,this.pending.promise.catch(e=>{}),yield yt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new ge,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function yt(t){return new Promise(a=>{setTimeout(a,t)})}var Ct={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},O=new Ke("appCheck","AppCheck",Ct);function nt(t){if(!C(t).activated)throw O.create("use-before-activation",{appName:t.name})}function rt(n,r){return b(this,arguments,function*({url:t,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let s={method:"POST",body:JSON.stringify(a),headers:o},l;try{l=yield fetch(t,s)}catch(f){throw O.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw O.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw O.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw O.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ot(t,a){let{projectId:e,appId:n,apiKey:r}=t.options;return{url:`${Tt}/projects/${e}/apps/${n}:${Et}?key=${r}`,body:{debug_token:a}}}var Pt="firebase-app-check-database",Dt=1,Te="firebase-app-check-store";var re=null;function Rt(){return re||(re=new Promise((t,a)=>{try{let e=indexedDB.open(Pt,Dt);e.onsuccess=n=>{t(n.target.result)},e.onerror=n=>{var r;a(O.create("storage-open",{originalErrorMessage:(r=n.target.error)===null||r===void 0?void 0:r.message}))},e.onupgradeneeded=n=>{let r=n.target.result;switch(n.oldVersion){case 0:r.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){a(O.create("storage-open",{originalErrorMessage:e?.message}))}}),re)}function _t(t,a){return xt(jt(t),a)}function xt(t,a){return b(this,null,function*(){let n=(yield Rt()).transaction(Te,"readwrite"),o=n.objectStore(Te).put({compositeKey:t,value:a});return new Promise((i,s)=>{o.onsuccess=l=>{i()},n.onerror=l=>{var c;s(O.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function jt(t){return`${t.options.appId}-${t.name}`}var J=new Ge("@firebase/app-check");function ke(t,a){return ze()?_t(t,a).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function it(){return tt().enabled}function at(){return b(this,null,function*(){let t=tt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Ot={error:"UNKNOWN_ERROR"};function Nt(t){return $e.encodeString(JSON.stringify(t),!1)}function Ee(t,a=!1,e=!1){return b(this,null,function*(){let n=t.app;nt(n);let r=C(n),o=r.token,i;if(o&&!Z(o)&&(r.token=void 0,o=void 0),!o){let c=yield r.cachedTokenPromise;c&&(Z(c)?o=c:yield ke(n,void 0))}if(!a&&o&&Z(o))return{token:o.token};let s=!1;if(it())try{r.exchangeTokenPromise||(r.exchangeTokenPromise=rt(ot(n,yield at()),t.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),s=!0);let c=yield r.exchangeTokenPromise;return yield ke(n,c),r.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),Ie(c)}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),s=!0),o=yield C(n).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),i=c}let l;return o?i?Z(o)?l={token:o.token,internalError:i}:l=Ie(i):(l={token:o.token},r.token=o,yield ke(n,o)):l=Ie(i),s&&Ft(n,l),l})}function Mt(t){return b(this,null,function*(){let a=t.app;nt(a);let{provider:e}=C(a);if(it()){let n=yield at(),{token:r}=yield rt(ot(a,n),t.heartbeatServiceProvider);return{token:r}}else{let{token:n}=yield e.getToken();return{token:n}}})}function Bt(t,a,e,n){let{app:r}=t,o=C(r),i={next:e,error:n,type:a};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&Z(o.token)){let s=o.token;Promise.resolve().then(()=>{e({token:s.token}),Qe(t)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Qe(t))}function st(t,a){let e=C(t),n=e.tokenObservers.filter(r=>r.next!==a);n.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=n}function Qe(t){let{app:a}=t,e=C(a),n=e.tokenRefresher;n||(n=Lt(t),e.tokenRefresher=n),!n.isRunning()&&e.isTokenAutoRefreshEnabled&&n.start()}function Lt(t){let{app:a}=t;return new be(()=>b(null,null,function*(){let e=C(a),n;if(e.token?n=yield Ee(t,!0):n=yield Ee(t),n.error)throw n.error;if(n.internalError)throw n.internalError}),()=>!0,()=>{let e=C(a);if(e.token){let n=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,r=e.token.expireTimeMillis-5*60*1e3;return n=Math.min(n,r),Math.max(0,n-Date.now())}else return 0},Ye.RETRIAL_MIN_WAIT,Ye.RETRIAL_MAX_WAIT)}function Ft(t,a){let e=C(t).tokenObservers;for(let n of e)try{n.type==="EXTERNAL"&&a.error!=null?n.error(a.error):n.next(a)}catch{}}function Z(t){return t.expireTimeMillis-Date.now()>0}function Ie(t){return{token:Nt(Ot),error:t}}var ye=class{constructor(a,e){this.app=a,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:a}=C(this.app);for(let e of a)st(this.app,e.next);return Promise.resolve()}};function Ut(t,a){return new ye(t,a)}function Wt(t){return{getToken:a=>Ee(t,a),getLimitedUseToken:()=>Mt(t),addTokenListener:a=>Bt(t,"INTERNAL",a),removeTokenListener:a=>st(t.app,a)}}var Ht="@firebase/app-check",$t="0.10.1";var zt="app-check",et="app-check-internal";function Kt(){Se(new me(zt,t=>{let a=t.getProvider("app").getImmediate(),e=t.getProvider("heartbeat");return Ut(a,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,a,e)=>{t.getProvider(et).initialize()})),Se(new me(et,t=>{let a=t.getProvider("app-check").getImmediate();return Wt(a)},"PUBLIC").setInstantiationMode("EXPLICIT")),q(Ht,$t)}Kt();var Gt="app-check";var oe=class{constructor(){return Xe(Gt)}};var Vt=["localhost","0.0.0.0","127.0.0.1"],er=typeof window<"u"&&Vt.includes(window.location.hostname);var E=function(t){return t.USER="user",t.CHANNELS="channels",t.AUTHORIZATION="Authorization",t.INTERCOM="Intercom",t}(E||{});var ct=(()=>{class t{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let r=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(r)),s=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(s));return l.header=o,l}catch{return!1}}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Zt="firebase",Xt="11.10.0";y.registerVersion(Zt,Xt,"app-compat");var Yt=["ngOnDestroy"],ut=(t,a,e,n={})=>new Proxy(t,{get:(r,o)=>e.runOutsideAngular(()=>{if(t[o])return n?.spy?.get&&n.spy.get(o,t[o]),t[o];if(Yt.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(s=>{let l=s?.[o];return typeof l=="function"?l.bind(s):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(s,l)=>i[l],apply:(s,l,c)=>i.then(d=>{let u=d?.(...c);return n?.spy?.apply&&n.spy.apply(o,c,u),u})})})});var ie=class{constructor(a){return a}},ae=new T("angularfire2.app.options"),se=new T("angularfire2.app.name");function Ce(t,a,e){let n=typeof e=="string"&&e||"[DEFAULT]",r=typeof e=="object"&&e||{};r.name=r.name||n;let i=y.apps.filter(s=>s&&s.name===r.name)[0]||a.runOutsideAngular(()=>y.initializeApp(t,r));try{if(JSON.stringify(t)!==JSON.stringify(i.options)){let s=!!module.hot;Qt("error",`${i.name} Firebase App already initialized with different options${s?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ie(i)}var Qt=(t,...a)=>{V()&&typeof console<"u"&&console[t](...a)},en={provide:ie,useFactory:Ce,deps:[ae,F,[new Me,se]]},qo=(()=>{class t{static initializeApp(e,n){return{ngModule:t,providers:[{provide:ae,useValue:e},{provide:se,useValue:n}]}}constructor(e){y.registerVersion("angularfire",H.full,"core"),y.registerVersion("angularfire",H.full,"app-compat"),y.registerVersion("angular",Le.full,e.toString())}static \u0275fac=function(n){return new(n||t)(h(U))};static \u0275mod=W({type:t});static \u0275inj=B({providers:[en]})}return t})();function dt(t,a,e,n,r){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(s=>s[0]===t)||[];if(o)return tn(r,i)||(lt("error",`${a} was already initialized on the ${e} Firebase App with different settings.${nn?" You may need to reload as Firebase is not HMR aware.":""}`),lt("warn",{is:r,was:i})),o;{let s=n();return globalThis.\u0275AngularfireInstanceCache.push([t,s,r]),s}}function tn(t,a){try{return t.toString()===a.toString()}catch{return t===a}}var nn=typeof module<"u"&&!!module.hot,lt=(t,...a)=>{V()&&typeof console<"u"&&console[t](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var rn=new T("angularfire2.auth.use-emulator"),on=new T("angularfire2.auth.settings"),an=new T("angularfire2.auth.tenant-id"),sn=new T("angularfire2.auth.langugage-code"),cn=new T("angularfire2.auth.use-device-language"),ln=new T("angularfire.auth.persistence"),un=(t,a,e,n,r,o,i,s)=>dt(`${t.name}.auth`,"AngularFireAuth",t.name,()=>{let l=a.runOutsideAngular(()=>t.auth());if(e&&l.useEmulator(...e),n&&(l.tenantId=n),l.languageCode=r,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return s&&l.setPersistence(s),l},[e,n,r,o,i,s]),Pe=(()=>{class t{injector=L(pe);authState;idToken;user;idTokenResult;credential;constructor(e,n,r,o,i,s,l,c,d,u,p,f){let $=new Y,N=K(void 0).pipe(z(i.outsideAngular),_(()=>o.runOutsideAngular(()=>import("./chunk-IIJMZKPL.js"))),D(()=>Ce(e,o,n)),D(P=>un(P,o,s,c,d,u,l,p)),de({bufferSize:1,refCount:!1}));if(We(r))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{N.pipe(Ne()).subscribe();let P=N.pipe(_(S=>S.getRedirectResult().then(R=>R,()=>null)),qe(this.injector),de({bufferSize:1,refCount:!1})),X=N.pipe(_(S=>new g(R=>({unsubscribe:o.runOutsideAngular(()=>S.onAuthStateChanged(M=>R.next(M),M=>R.error(M),()=>R.complete()))})))),ce=N.pipe(_(S=>new g(R=>({unsubscribe:o.runOutsideAngular(()=>S.onIdTokenChanged(M=>R.next(M),M=>R.error(M),()=>R.complete()))}))));this.authState=P.pipe(he(X),Q(i.outsideAngular),z(i.insideAngular)),this.user=P.pipe(he(ce),Q(i.outsideAngular),z(i.insideAngular)),this.idToken=this.user.pipe(_(S=>S?x(S.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(_(S=>S?x(S.getIdTokenResult()):K(null))),this.credential=je(P,$,this.authState.pipe(Oe(S=>!S))).pipe(D(S=>S?.user?S:null),Q(i.outsideAngular),z(i.insideAngular))}return ut(this,N,o,{spy:{apply:(P,X,ce)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ce.then(S=>$.next(S))}}})}static \u0275fac=function(n){return new(n||t)(h(ae),h(se,8),h(U),h(F),h(we),h(rn,8),h(on,8),h(an,8),h(sn,8),h(cn,8),h(ln,8),h(oe,8))};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"any"})}return t})(),ui=(()=>{class t{constructor(){y.registerVersion("angularfire",H.full,"auth-compat")}static \u0275fac=function(n){return new(n||t)};static \u0275mod=W({type:t});static \u0275inj=B({providers:[Pe]})}return t})();function m(t,a,e,n){return new Promise((r,o)=>{t||o("IndexedDB not available");let i=t.open(a,e),s;i.onsuccess=l=>{s=i.result,r(s)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof n=="function"&&(i.onupgradeneeded=l=>{n(l,s)})})}function ht(t,a,e,n,r){if(!t)return;let o=t.open(a,e);o.onupgradeneeded=i=>{let s=i.target.result;n.forEach(c=>{if(!s.objectStoreNames.contains(c.store)){let d=s.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=r&&r();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](s,o.transaction)}),s.close()},o.onsuccess=i=>{i.target.result.close()}}function hn(t,a,e){if(!t||!a||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(n=>{try{let r=a+1,o=indexedDB.open(t,r);o.onupgradeneeded=i=>{let s=i.target.result;s.deleteObjectStore(e),s.close(),console.log("onupgradeneeded"),n.next(!0),n.complete()},o.onerror=i=>n.error(i)}catch(r){n.error(r)}})}function pn(t,a){return t.objectStoreNames.contains(a)}function I(t,a,e){t||e("You need to use the openDatabase function to create a database before you query it!"),pn(t,a)||e(`objectStore does not exists: ${a}`)}function v(t,a){let e=t.transaction(a.storeName,a.dbMode);return e.onerror=a.error,e.onabort=a.abort,e}function w(t,a,e,n){return{storeName:a,dbMode:t,error:r=>{e(r)},abort:r=>{e(r)}}}var A=function(t){return t.readonly="readonly",t.readwrite="readwrite",t}(A||{}),pt=new T(null),De=(()=>{class t{constructor(e,n){if(this.dbConfig=e,this.platformId=n,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ue(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ht(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(r=>{r.version!==e.version&&(this.dbConfig.version=r.version)}))}createObjectStore(e,n){let r=[e];ht(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,r,n)}add(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=v(i,w(A.readwrite,e,d=>o.error(d))).objectStore(e),c=r?l.add(n,r):l.add(n);c.onsuccess=d=>b(this,null,function*(){let u=d.target.result,p=l.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(i=>o.error(i))})}bulkAdd(e,n){let r=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=v(s,w(A.readwrite,e,o,i)).objectStore(e),d=n.map(u=>new Promise((p,f)=>{let $=u.key;delete u.key;let N=$?c.add(u,$):c.add(u);N.onsuccess=P=>{let X=P.target.result;p(X)}}));o(Promise.all(d))}).catch(s=>i(s))});return x(r)}bulkDelete(e,n){let r=n.map(o=>new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=v(l,w(A.readwrite,e,s,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(u=>{i(u)})}}).catch(l=>s(l))}));return x(Promise.all(r))}getByKey(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=v(o,w(A.readonly,e,r.error)).objectStore(e).get(n);l.onsuccess=c=>{r.next(c.target.result),r.complete()},l.onerror=c=>{r.error(c)}}).catch(o=>r.error(o))})}bulkGet(e,n){let r=n.map(o=>this.getByKey(e,o));return new g(o=>{xe(r).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let l=v(o,w(A.readonly,e,r.error,r.next)).objectStore(e).get(n);l.onsuccess=c=>{r.next(c.target.result)}}).catch(o=>r.error(o))})}getByIndex(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,e,u=>o.error(u));let d=v(i,w(A.readonly,e,o.error)).objectStore(e).index(n).get(r);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{I(r,e,l=>n.error(l));let s=v(r,w(A.readonly,e,n.error,n.next)).objectStore(e).getAll();s.onerror=l=>{n.error(l)},s.onsuccess=({target:{result:l}})=>{n.next(l),n.complete()}}).catch(r=>n.error(r))})}update(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let s=v(o,w(A.readwrite,e,c=>r.error(c))).objectStore(e),l=s.put(n);l.onsuccess=c=>b(this,null,function*(){let d=c.target.result,u=s.get(d);u.onsuccess=p=>{r.next(p.target.result),r.complete()}})}).catch(o=>r.error(o))})}delete(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,l=>r.error(l));let i=v(o,w(A.readwrite,e,l=>r.error(l)));i.objectStore(e).delete(n),i.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(l=>{r.next(l),r.complete()})}}).catch(o=>r.error(o))})}deleteByKey(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,l=>r.error(l));let i=v(o,w(A.readwrite,e,l=>r.error(l))),s=i.objectStore(e);i.oncomplete=()=>{r.next(!0),r.complete()},s.delete(n)}).catch(o=>r.error(o))})}clear(e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{I(r,e,s=>n.error(s));let o=v(r,w(A.readwrite,e,s=>n.error(s)));o.objectStore(e).clear(),o.oncomplete=()=>{n.next(!0),n.complete()}}).catch(r=>n.error(r))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>b(this,null,function*(){yield n.close();let r=this.indexedDB.deleteDatabase(this.dbConfig.name);r.onsuccess=()=>{e.next(!0),e.complete()},r.onerror=o=>e.error(o),r.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(n=>e.error(n))})}openCursor(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let s=v(o,w(A.readonly,e,r.error)).objectStore(e),l=n===void 0?s.openCursor():s.openCursor(n);l.onsuccess=c=>{r.next(c),r.complete()}}).catch(o=>r.error(o))})}openCursorByIndex(e,n,r,o=A.readonly){let i=new Y;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,e,p=>{i.error(p)});let u=v(s,w(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(n).openCursor(r);u.onsuccess=p=>{i.next(p)}}).catch(s=>i.error(s)),i}getAllByIndex(e,n,r){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,e,p=>i.error(p));let u=v(s,w(A.readonly,e,i.error)).objectStore(e).index(n).openCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(s=>i.error(s))})}getAllKeysByIndex(e,n,r){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,e,p=>i.error(p));let u=v(s,w(A.readonly,e,i.error)).objectStore(e).index(n).openKeyCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(i.next(o),i.complete())}}).catch(s=>i.error(s))})}count(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let l=v(o,w(A.readonly,e,r.error)).objectStore(e).count(n);l.onerror=c=>r.error(c),l.onsuccess=c=>{r.next(c.target.result),r.complete()}}).catch(o=>r.error(o))})}countByIndex(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,e,u=>o.error(u));let d=v(i,w(A.readonly,e,o.error)).objectStore(e).index(n).count(r);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return hn(this.dbConfig.name,++this.dbConfig.version,e)}}return t.\u0275fac=function(e){return new(e||t)(h(pt),h(U))},t.\u0275prov=k({token:t,factory:t.\u0275fac}),t})(),Ai=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[De,{provide:pt,useValue:e}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=W({type:t}),t.\u0275inj=B({imports:[[Fe]]}),t})();var ft=(()=>{class t{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let r=this.getKey(n);return this.db.add(this.DATABASE,e,r).pipe(D(o=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case fe.Lazada:n="Lazada";break;case fe.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}static{this.\u0275fac=function(n){return new(n||t)(h(De))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var gt=(()=>{class t{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=le(le({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return ee.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var mt=(()=>{class t{static{this.SubmitConfig="/api/Channel/SubmitConfig"}static{this.PosAccountTest="/api/POSAccount/Test"}static{this.PosAccountRemove="/api/POSAccount/Remove"}static{this.PosAccountGetConfig="/api/ChannelLoader/GetConfig"}static{this.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID"}static{this.GetChannel="/api/Channel/GetChannel"}static{this.GetChannelLoader="/api/ChannelLoader/GetChannelLoader"}static{this.TestShopID="/api/Channel/TestShopID"}static{this.UpdateChannelIndex="/api/Channel/UpdateChannelIndex"}static{this.DeleteChannel="/api/Channel/DeleteChannel"}static{this.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder"}static{this.GetChannelRowCount="/api/Channel/GetCountChannel"}static{this.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation"}static{this.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse"}static{this.GetChannelDetail="/api/ChannelLoader/GetChannelView"}static{this.GetOrderPreview="/api/Orders/Preview"}static{this.GetOrderPreviewV2="/api/Orders/PreviewV2"}static{this.GetDownloadOrder="/api/Orders/Download"}static{this.GetDownloadOrderV2="/api/Orders/DownloadV2"}static{this.ShopeeV2_URL="/api/ChannelAuthorization/ShopeeV2_URL"}static{this.Tiktok_URL="/api/ChannelAuthorization/Tiktok_URL"}static{this.Lazada_URL="/api/ChannelAuthorization/Lazada_URL"}static{this.AddTokopedia="/api/ChannelAdd/Tokopedia"}static{this.AddShopify="/api/ChannelAdd/AddShopify"}static{this.AddWoocommerce="/api/ChannelAdd/AddWooCommerce"}static{this.AddPlugo="/api/ChannelAdd/Plugo"}static{this.UploadPlugoProduct="/api/product/plugo/AddProduct"}static{this.RefreshToken="/api/RefreshToken"}static{this.RefreshInventory="/api/Inventory/RefreshInventory"}}return t})();var St=(()=>{class t{constructor(){this.httpService=L(te)}refreshToken(){return this.httpService.get(mt.RefreshToken).pipe(G(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let n=JSON.stringify(e);localStorage.setItem(E.USER,n)}getUser(){let e=localStorage.getItem(E.USER);return e?JSON.parse(e):null}saveChannelsToLocalStorage(e){let n=JSON.stringify(e);localStorage.setItem(E.CHANNELS,n)}getChannels(){let e=localStorage.getItem(E.CHANNELS);return e?JSON.parse(e):[]}clearStorage(){localStorage.removeItem(E.USER),localStorage.removeItem(E.CHANNELS)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fi=(()=>{class t{constructor(e,n,r,o,i,s,l,c){this.httpService=e,this.tokenDecodeService=n,this.afAuth=r,this.ngxPermission=o,this.localDataService=i,this.router=s,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(G(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ze.news).pipe(D(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let r=new Ae;return r.setCustomParameters({prompt:"select_account"}),x(this.afAuth.signInWithPopup(r)).pipe(D(o=>o.credential),D(o=>o.idToken),_(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:n}))),G(o=>{this.setLocalStorage(o,n,null),this.loadPermissions()}))}setLocalStorage(e,n,r){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(E.AUTHORIZATION,JSON.stringify({Host:n,username:r})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(E.USER);if(ee.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),n=new Date;if(e!=null){let r=new Date(e.Token.expiredAt);return n<r?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(E.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}static{this.\u0275fac=function(n){return new(n||t)(h(te),h(ct),h(Pe),h(Je),h(ft),h(He),h(gt),h(St))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{Ze as a,E as b,ct as c,qo as d,ui as e,Ai as f,ft as g,mt as h,St as i,Fi as j};
@@ -1 +1 @@
1
- import{a as N,b as Ot,c as Se}from"./chunk-ZCGHEDGV.js";import"./chunk-64V4L3IJ.js";import"./chunk-MS4AQ6UA.js";import{a as j}from"./chunk-6HVHZ3HN.js";import{a as fe}from"./chunk-PF4F4EAR.js";import{a as Y}from"./chunk-7KG3DC5J.js";import{b as Ce}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as ee,b as ne}from"./chunk-ARIW575T.js";import{e as rt}from"./chunk-R4FFSLZS.js";import{a as ve}from"./chunk-T7KM2WP6.js";import{i as me,j as ue,k as he,l as _e,m as ge}from"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import"./chunk-UOAYF4SW.js";import{a as B}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Tt}from"./chunk-5UHZLNDT.js";import{a as J}from"./chunk-DG3PIXFJ.js";import{b as xe}from"./chunk-WYOXUN3H.js";import{a as se,b as pe}from"./chunk-23MIIDCT.js";import{a as ie,b as oe,c as re}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as X}from"./chunk-MV2W43TI.js";import{a as Z}from"./chunk-67USXWWF.js";import{c as ce}from"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import{a as de}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import{a as le}from"./chunk-R5IDWUP6.js";import{f as ae}from"./chunk-4RAOUTR2.js";import{a as ot,b as wt,d as H,e as Yt}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as L}from"./chunk-CIKNTHCR.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as Zt,c as qt,d as K,h as Dt,i as Qt,j as Xt,l as R,m as te}from"./chunk-XOT2SZPE.js";import{r as yt,s as Mt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Ht,c as it,h as A,m as U,y as It}from"./chunk-AI4XRCAL.js";import{b as z,c as C}from"./chunk-W6T7TOHE.js";import{E as Pt,F as Jt,G as nt,H as bt,J as zt,f as E,g as V,j as St,k as Kt,m as xt,n as vt}from"./chunk-B6POIFQM.js";import{Dc as $,Eb as M,Ec as d,Fb as Gt,Fc as tt,G as w,Gc as b,Ic as D,Jc as O,Kb as S,Kc as T,Nc as Q,Oc as st,Qa as At,Wb as c,Xc as F,Yc as k,Zc as Wt,_c as et,aa as Ct,bc as ft,ca as kt,ea as jt,f as Rt,gc as o,hc as r,ic as _,jc as v,ka as $t,kc as P,mc as x,ob as y,pa as Vt,qb as a,rc as g,sc as s,v as Bt,wb as f,ya as m,za as u}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),_(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",Q(2,Ne)))},dependencies:[ee,Jt,bt],encapsulation:2})}}return i})();function ke(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,y),a(2),tt(t.Title)}}var lt=(()=>{class i{constructor(){this.dialogRef=Vt(Zt),this.channels=Vt(qt),this.channelIds=At([]),this.channelOptions=At([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Qt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return O(e.channelIds,h)||(e.channelIds=h),h}),S(7,ke,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),D("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[vt,E,Xt,le,ae,pe,se,ce,It,A,U,Mt],encapsulation:2})}}return i})();function Ve(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ae(i,p){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),d(2," Scan Channel "),r()}}function Ue(i,p){if(i&1&&(v(0),S(1,Ae,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Le(i,p){if(i&1){let t=x();v(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Re(i,p){if(i&1){let t=x();v(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Be(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function je(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function $e(i,p){if(i&1){let t=x();v(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var we=(()=>{class i{constructor(t,n,e,l,h,I,ct){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=I,this.route=ct,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(l=>C.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(I)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(G),f(K),f(B),f(L),f(rt),f(nt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=x();o(0,"mainpanel",1),g("onSubmit",function(I){return m(l),u(e.searchProduct(I))}),o(1,"actions"),S(2,Ve,3,1,"button",2)(3,Ue,2,1,"ng-container",3)(4,Le,4,1,"ng-container",3)(5,Re,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),g("ngModelChange",function(I){return m(l),u(e.searchFilter.Category=I)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(I){return m(l),O(e.startDate,I)||(e.startDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r(),o(14,"input",9),T("ngModelChange",function(I){return m(l),O(e.endDate,I)||(e.endDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r()(),_(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),S(20,Be,2,11,"div",12)(21,je,3,0,"ng-container",3),r(),S(22,$e,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),D("ngModel",e.startDate),a(),D("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[E,V,it,A,U,R,H,J,Z,j,me,ue,he,_e],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}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Ge(i,p){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function We(i,p){if(i&1){let t=x();v(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),d(3," Scan Channel "),r(),P()}}function Ke(i,p){if(i&1){let t=x();v(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Je(i,p){if(i&1){let t=x();v(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function ze(i,p){if(i&1&&(o(0,"span",18),_(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function He(i,p){if(i&1){let t=x();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return O(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),D("ngModel",t.searchFilter.Item_id)}}function Ye(i,p){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function Ze(i,p){i&1&&(v(0),o(1,"div",25),_(2,"app-empty-state"),r(),P())}function qe(i,p){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var ye=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=I,this.route=ct,this.uploadProductService=gt,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(w(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(B),f(Pt),f(L),f(nt),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),S(2,Ge,3,1,"button",1)(3,We,4,0,"ng-container",2)(4,Ke,4,1,"ng-container",2)(5,Je,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),S(11,ze,3,3,"ng-template",5),r()(),S(12,He,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),S(16,Ye,2,11,"div",9)(17,Ze,3,0,"ng-container",2),r(),S(18,qe,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[E,V,it,A,U,R,H,ot,wt,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function Xe(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function tn(i,p){if(i&1){let t=x();v(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return O(l.selected,e)||(l.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function en(i,p){if(i&1){let t=x();v(0),o(1,"img",35),g("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,y)}}function nn(i,p){i&1&&_(0,"img",36)}function on(i,p){if(i&1&&(v(0),o(1,"td",29)(2,"div",31),S(3,en,2,1,"ng-container",11)(4,nn,1,0,"ng-template",null,1,et),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function rn(i,p){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,y),a(),c("src",t.Img,y)("matTooltip",t.Name)}}function an(i,p){if(i&1&&(o(0,"div"),_(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,y)("matTooltip",t.Name)}}function ln(i,p){if(i&1&&(o(0,"tr"),S(1,tn,3,2,"ng-container",12)(2,on,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),_(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),S(13,rn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),S(16,an,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),y),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function cn(i,p){if(i&1&&(v(0),S(1,ln,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function sn(i,p){if(i&1&&(o(0,"tbody"),S(1,cn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function pn(i,p){if(i&1&&(v(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),S(16,sn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",k(17,1,t.data$))}}function dn(i,p){i&1&&(o(0,"div",38),_(1,"app-empty-state"),r())}function mn(i,p){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function un(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),tt(k(2,1,t==null?null:t.Count))}}function hn(i,p){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),d(2," Next"),r()}}function _n(i,p){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),d(2," Last"),r()}}function gn(i,p){if(i&1&&(v(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),S(6,mn,3,0,"span",42)(7,un,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),S(11,hn,3,0,"a",44)(12,_n,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",k(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&k(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Cn(i,p){if(i&1&&(v(0),S(1,gn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function fn(i,p){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),S(2,Xe,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),S(13,pn,18,3,"ng-container",11),F(14,"async"),S(15,dn,2,0,"ng-template",null,0,et),r(),S(17,Cn,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=k(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",k(18,7,e.data$))}}var Me=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt,Ee){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=I,this.biggerPictureService=ct,this.authService=gt,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=gt.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(jt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Bt(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=C.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Ce,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(nt),f(B),f(fe),f(de),f(L),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[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"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(S(0,fn,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",k(1,1,e.loader$))},dependencies:[E,V,Ht,A,U,R,yt,j,St,xt],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}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Sn=i=>[i],xn=()=>[];function vn(i,p){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),d(2," Scan Channel "),r()}}function Pn(i,p){if(i&1){let t=x();v(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function bn(i,p){if(i&1&&(o(0,"span",19),_(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function In(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?st(10,Sn,t==null?null:t.Channel):Q(12,xn))("showCheckBox",!0)("scanButton",!0)}}function wn(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function yn(i,p){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var De=(()=>{class i{constructor(t,n,e,l,h,I){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=I,this.searchFilter=new Y,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Se,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(B),f(G),f(Pt),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[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",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),S(2,vn,3,0,"button",1)(3,Pn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return O(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),S(9,bn,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return O(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return O(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),S(27,In,2,13,"div",13)(28,wn,3,0,"ng-container",2),r(),S(29,yn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ChannelID),a(5),D("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),D("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,it,A,U,R,H,ot,ie,oe,J,Z,j],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}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Mn(i,p){if(i&1&&(o(0,"span",9),_(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),y),a(),b(" ",t.Name," ")}}function Dn(i,p){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function On(i,p){i&1&&(v(0),o(1,"div",13),_(2,"app-empty-state"),r(),P())}function Tn(i,p){if(i&1){let t=x();v(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var Oe=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new Y,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(B),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return O(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),S(7,Mn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),S(11,Dn,2,6,"div",7)(12,On,3,0,"ng-container",8),r(),S(13,Tn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,A,U,R,H,ot,wt,Tt,J,j],encapsulation:2})}}return i})();var Fn=()=>["/menu/products/status/sold-in-channel"],Te=i=>({ID:i}),En=()=>["/menu/products/status/not-in-pos"];function Nn(i,p){if(i&1&&(v(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function kn(i,p){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),_(1,"i",27),r()}}function Vn(i,p){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),S(6,Nn,2,1,"ng-container",6)(7,kn,2,0,"ng-template",null,1,et),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),_(23,"i",23),d(24," Scan "),r(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),_(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),y),a(2),tt(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",Q(18,Fn))("queryParams",st(19,Te,t.ID)),a(),b(" ",k(12,11,t.SoldInChannel)," "),a(3),c("routerLink",Q(21,En))("queryParams",st(22,Te,t.ID)),a(),b(" ",k(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Wt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function An(i,p){if(i&1&&(v(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),_(15,"th",15),r()(),o(16,"tbody"),S(17,Vn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=k(18,1,n.channels$))==null?null:t.Data)}}function Un(i,p){i&1&&(o(0,"div",28),_(1,"app-empty-state"),r())}var Fe=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Rt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(w(n=>C.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(w(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(kt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(f(B),f(G),f(K),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,An,19,3,"ng-container",6),F(6,"async"),S(7,Un,2,0,"ng-template",null,0,et),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=k(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[E,V,R,yt,bt,j,St,xt,Kt],encapsulation:2})}}return i})();var Ln=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[X],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[X],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[X],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[X],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[X],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[X],data:{title:"Channel Statistic"}}]}],uo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Gt({type:i})}static{this.\u0275inj=$t({imports:[vt,It,te,Mt,Yt,xe,re,ne,Tt,J,Z,zt.forChild(Ln),ge,ve,lt]})}}return i})();export{uo as StatusModule};
1
+ import{a as N,b as Ot,c as Se}from"./chunk-2GZHR5B6.js";import"./chunk-UKPQ245L.js";import"./chunk-MS4AQ6UA.js";import{a as j}from"./chunk-6HVHZ3HN.js";import{a as fe}from"./chunk-PF4F4EAR.js";import{a as Y}from"./chunk-7KG3DC5J.js";import{b as Ce}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as ee,b as ne}from"./chunk-ARIW575T.js";import{e as rt}from"./chunk-TRGSTYXO.js";import{a as ve}from"./chunk-T7KM2WP6.js";import{i as me,j as ue,k as he,l as _e,m as ge}from"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import"./chunk-UOAYF4SW.js";import{a as B}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Tt}from"./chunk-5UHZLNDT.js";import{a as J}from"./chunk-DG3PIXFJ.js";import{b as xe}from"./chunk-WYOXUN3H.js";import{a as se,b as pe}from"./chunk-23MIIDCT.js";import{a as ie,b as oe,c as re}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as X}from"./chunk-4RQOSK5F.js";import{a as Z}from"./chunk-67USXWWF.js";import{c as ce}from"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import{a as de}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import{a as le}from"./chunk-R5IDWUP6.js";import{f as ae}from"./chunk-4RAOUTR2.js";import{a as ot,b as wt,d as H,e as Yt}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as L}from"./chunk-PRTTKQS3.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as Zt,c as qt,d as K,h as Dt,i as Qt,j as Xt,l as R,m as te}from"./chunk-XOT2SZPE.js";import{r as yt,s as Mt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Ht,c as it,h as A,m as U,y as It}from"./chunk-AI4XRCAL.js";import{b as z,c as C}from"./chunk-W6T7TOHE.js";import{E as Pt,F as Jt,G as nt,H as bt,J as zt,f as E,g as V,j as St,k as Kt,m as xt,n as vt}from"./chunk-B6POIFQM.js";import{Dc as $,Eb as M,Ec as d,Fb as Gt,Fc as tt,G as w,Gc as b,Ic as D,Jc as O,Kb as S,Kc as T,Nc as Q,Oc as st,Qa as At,Wb as c,Xc as F,Yc as k,Zc as Wt,_c as et,aa as Ct,bc as ft,ca as kt,ea as jt,f as Rt,gc as o,hc as r,ic as _,jc as v,ka as $t,kc as P,mc as x,ob as y,pa as Vt,qb as a,rc as g,sc as s,v as Bt,wb as f,ya as m,za as u}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),_(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",Q(2,Ne)))},dependencies:[ee,Jt,bt],encapsulation:2})}}return i})();function ke(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,y),a(2),tt(t.Title)}}var lt=(()=>{class i{constructor(){this.dialogRef=Vt(Zt),this.channels=Vt(qt),this.channelIds=At([]),this.channelOptions=At([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Qt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return O(e.channelIds,h)||(e.channelIds=h),h}),S(7,ke,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),D("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[vt,E,Xt,le,ae,pe,se,ce,It,A,U,Mt],encapsulation:2})}}return i})();function Ve(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ae(i,p){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),d(2," Scan Channel "),r()}}function Ue(i,p){if(i&1&&(v(0),S(1,Ae,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Le(i,p){if(i&1){let t=x();v(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Re(i,p){if(i&1){let t=x();v(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Be(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function je(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function $e(i,p){if(i&1){let t=x();v(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var we=(()=>{class i{constructor(t,n,e,l,h,I,ct){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=I,this.route=ct,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(l=>C.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(I)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(G),f(K),f(B),f(L),f(rt),f(nt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=x();o(0,"mainpanel",1),g("onSubmit",function(I){return m(l),u(e.searchProduct(I))}),o(1,"actions"),S(2,Ve,3,1,"button",2)(3,Ue,2,1,"ng-container",3)(4,Le,4,1,"ng-container",3)(5,Re,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),g("ngModelChange",function(I){return m(l),u(e.searchFilter.Category=I)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(I){return m(l),O(e.startDate,I)||(e.startDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r(),o(14,"input",9),T("ngModelChange",function(I){return m(l),O(e.endDate,I)||(e.endDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r()(),_(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),S(20,Be,2,11,"div",12)(21,je,3,0,"ng-container",3),r(),S(22,$e,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),D("ngModel",e.startDate),a(),D("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[E,V,it,A,U,R,H,J,Z,j,me,ue,he,_e],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}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Ge(i,p){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function We(i,p){if(i&1){let t=x();v(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),d(3," Scan Channel "),r(),P()}}function Ke(i,p){if(i&1){let t=x();v(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Je(i,p){if(i&1){let t=x();v(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function ze(i,p){if(i&1&&(o(0,"span",18),_(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function He(i,p){if(i&1){let t=x();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return O(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),D("ngModel",t.searchFilter.Item_id)}}function Ye(i,p){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function Ze(i,p){i&1&&(v(0),o(1,"div",25),_(2,"app-empty-state"),r(),P())}function qe(i,p){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var ye=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=I,this.route=ct,this.uploadProductService=gt,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(w(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(B),f(Pt),f(L),f(nt),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),S(2,Ge,3,1,"button",1)(3,We,4,0,"ng-container",2)(4,Ke,4,1,"ng-container",2)(5,Je,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),S(11,ze,3,3,"ng-template",5),r()(),S(12,He,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),S(16,Ye,2,11,"div",9)(17,Ze,3,0,"ng-container",2),r(),S(18,qe,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[E,V,it,A,U,R,H,ot,wt,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function Xe(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function tn(i,p){if(i&1){let t=x();v(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return O(l.selected,e)||(l.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function en(i,p){if(i&1){let t=x();v(0),o(1,"img",35),g("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,y)}}function nn(i,p){i&1&&_(0,"img",36)}function on(i,p){if(i&1&&(v(0),o(1,"td",29)(2,"div",31),S(3,en,2,1,"ng-container",11)(4,nn,1,0,"ng-template",null,1,et),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function rn(i,p){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,y),a(),c("src",t.Img,y)("matTooltip",t.Name)}}function an(i,p){if(i&1&&(o(0,"div"),_(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,y)("matTooltip",t.Name)}}function ln(i,p){if(i&1&&(o(0,"tr"),S(1,tn,3,2,"ng-container",12)(2,on,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),_(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),S(13,rn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),S(16,an,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),y),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function cn(i,p){if(i&1&&(v(0),S(1,ln,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function sn(i,p){if(i&1&&(o(0,"tbody"),S(1,cn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function pn(i,p){if(i&1&&(v(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),S(16,sn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",k(17,1,t.data$))}}function dn(i,p){i&1&&(o(0,"div",38),_(1,"app-empty-state"),r())}function mn(i,p){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function un(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),tt(k(2,1,t==null?null:t.Count))}}function hn(i,p){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),d(2," Next"),r()}}function _n(i,p){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),d(2," Last"),r()}}function gn(i,p){if(i&1&&(v(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),S(6,mn,3,0,"span",42)(7,un,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),S(11,hn,3,0,"a",44)(12,_n,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",k(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&k(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Cn(i,p){if(i&1&&(v(0),S(1,gn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function fn(i,p){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),S(2,Xe,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),S(13,pn,18,3,"ng-container",11),F(14,"async"),S(15,dn,2,0,"ng-template",null,0,et),r(),S(17,Cn,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=k(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",k(18,7,e.data$))}}var Me=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt,Ee){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=I,this.biggerPictureService=ct,this.authService=gt,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=gt.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(jt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Bt(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=C.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Ce,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(nt),f(B),f(fe),f(de),f(L),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[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"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(S(0,fn,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",k(1,1,e.loader$))},dependencies:[E,V,Ht,A,U,R,yt,j,St,xt],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}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Sn=i=>[i],xn=()=>[];function vn(i,p){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),d(2," Scan Channel "),r()}}function Pn(i,p){if(i&1){let t=x();v(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function bn(i,p){if(i&1&&(o(0,"span",19),_(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function In(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?st(10,Sn,t==null?null:t.Channel):Q(12,xn))("showCheckBox",!0)("scanButton",!0)}}function wn(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function yn(i,p){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var De=(()=>{class i{constructor(t,n,e,l,h,I){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=I,this.searchFilter=new Y,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Se,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(B),f(G),f(Pt),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[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",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),S(2,vn,3,0,"button",1)(3,Pn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return O(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),S(9,bn,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return O(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return O(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),S(27,In,2,13,"div",13)(28,wn,3,0,"ng-container",2),r(),S(29,yn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ChannelID),a(5),D("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),D("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,it,A,U,R,H,ot,ie,oe,J,Z,j],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}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Mn(i,p){if(i&1&&(o(0,"span",9),_(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),y),a(),b(" ",t.Name," ")}}function Dn(i,p){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function On(i,p){i&1&&(v(0),o(1,"div",13),_(2,"app-empty-state"),r(),P())}function Tn(i,p){if(i&1){let t=x();v(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var Oe=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new Y,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(B),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return O(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),S(7,Mn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),S(11,Dn,2,6,"div",7)(12,On,3,0,"ng-container",8),r(),S(13,Tn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,A,U,R,H,ot,wt,Tt,J,j],encapsulation:2})}}return i})();var Fn=()=>["/menu/products/status/sold-in-channel"],Te=i=>({ID:i}),En=()=>["/menu/products/status/not-in-pos"];function Nn(i,p){if(i&1&&(v(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function kn(i,p){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),_(1,"i",27),r()}}function Vn(i,p){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),S(6,Nn,2,1,"ng-container",6)(7,kn,2,0,"ng-template",null,1,et),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),_(23,"i",23),d(24," Scan "),r(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),_(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),y),a(2),tt(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",Q(18,Fn))("queryParams",st(19,Te,t.ID)),a(),b(" ",k(12,11,t.SoldInChannel)," "),a(3),c("routerLink",Q(21,En))("queryParams",st(22,Te,t.ID)),a(),b(" ",k(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Wt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function An(i,p){if(i&1&&(v(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),_(15,"th",15),r()(),o(16,"tbody"),S(17,Vn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=k(18,1,n.channels$))==null?null:t.Data)}}function Un(i,p){i&1&&(o(0,"div",28),_(1,"app-empty-state"),r())}var Fe=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Rt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(w(n=>C.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(w(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(kt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(f(B),f(G),f(K),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,An,19,3,"ng-container",6),F(6,"async"),S(7,Un,2,0,"ng-template",null,0,et),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=k(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[E,V,R,yt,bt,j,St,xt,Kt],encapsulation:2})}}return i})();var Ln=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[X],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[X],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[X],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[X],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[X],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[X],data:{title:"Channel Statistic"}}]}],uo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Gt({type:i})}static{this.\u0275inj=$t({imports:[vt,It,te,Mt,Yt,xe,re,ne,Tt,J,Z,zt.forChild(Ln),ge,ve,lt]})}}return i})();export{uo as StatusModule};