marketplacepos 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/Marketplace/{chunk-WYMCYQCR.js → chunk-2GOE5RBJ.js} +1 -1
  2. package/Marketplace/{chunk-GMALFTAY.js → chunk-2QO2D23V.js} +1 -1
  3. package/Marketplace/{chunk-WBI4ZM2X.js → chunk-2Y47HNW5.js} +1 -1
  4. package/Marketplace/{chunk-LKSBRXCX.js → chunk-32YQ5ZBK.js} +1 -1
  5. package/Marketplace/{chunk-GFW452UY.js → chunk-353KSOKY.js} +1 -1
  6. package/Marketplace/{chunk-DBEZLCZM.js → chunk-3MUYDBXT.js} +1 -1
  7. package/Marketplace/{chunk-YQEEQRFM.js → chunk-55NPYZ64.js} +1 -1
  8. package/Marketplace/{chunk-QK2PM3OO.js → chunk-5PV4AXUR.js} +1 -1
  9. package/Marketplace/{chunk-QKVTZKIC.js → chunk-5UESNVF7.js} +1 -1
  10. package/Marketplace/{chunk-2KQ4WEPD.js → chunk-5YX57TZJ.js} +1 -1
  11. package/Marketplace/{chunk-2OB3TW2H.js → chunk-6FFJWFMY.js} +1 -1
  12. package/Marketplace/{chunk-G5D7W2T3.js → chunk-7AS2YI3I.js} +1 -1
  13. package/Marketplace/{chunk-VRSV5O5R.js → chunk-AN4U7FVT.js} +1 -1
  14. package/Marketplace/{chunk-MRWTB7OG.js → chunk-B6ZV4WVU.js} +1 -1
  15. package/Marketplace/{chunk-4O5EV6W4.js → chunk-BBX2DZWF.js} +1 -1
  16. package/Marketplace/{chunk-MA4ZKUP6.js → chunk-BLRV33OB.js} +2 -2
  17. package/Marketplace/{chunk-XWIBRKIY.js → chunk-BTKP3PJH.js} +1 -1
  18. package/Marketplace/{chunk-YWVMHX45.js → chunk-CA4NYL7C.js} +1 -1
  19. package/Marketplace/{chunk-TT7NBZMD.js → chunk-CFL3VDAM.js} +1 -1
  20. package/Marketplace/{chunk-3ICHEZSE.js → chunk-DE2BZXNA.js} +1 -1
  21. package/Marketplace/{chunk-TQ6UUVH3.js → chunk-DE6KXPBU.js} +1 -1
  22. package/Marketplace/{chunk-BYDOIRDD.js → chunk-FDGOGKXD.js} +1 -1
  23. package/Marketplace/{chunk-7RCRNZNI.js → chunk-FDYGWNMG.js} +1 -1
  24. package/Marketplace/{chunk-SWQXA73A.js → chunk-FR67IIWG.js} +1 -1
  25. package/Marketplace/{chunk-67YIEWYV.js → chunk-G6DYB24N.js} +1 -1
  26. package/Marketplace/{chunk-T6XRWLCZ.js → chunk-GUKAWOAK.js} +1 -1
  27. package/Marketplace/{chunk-VIJ5HUKS.js → chunk-HDWZXE6G.js} +1 -1
  28. package/Marketplace/{chunk-I4V2RPID.js → chunk-HQTUUTDT.js} +1 -1
  29. package/Marketplace/{chunk-H7KLY4IB.js → chunk-HTODD7RF.js} +1 -1
  30. package/Marketplace/{chunk-SKA4KCAB.js → chunk-I2FTGSXA.js} +1 -1
  31. package/Marketplace/{chunk-O3V3GTIM.js → chunk-IGSHV4S3.js} +1 -1
  32. package/Marketplace/{chunk-MORUNYG3.js → chunk-IJ3WNDAP.js} +1 -1
  33. package/Marketplace/{chunk-YQXKX6O7.js → chunk-J55273WG.js} +1 -1
  34. package/Marketplace/{chunk-IJIIMLQ7.js → chunk-JI67LAJB.js} +1 -1
  35. package/Marketplace/{chunk-PJQTGT4K.js → chunk-JJXHYCB6.js} +1 -1
  36. package/Marketplace/{chunk-RFTG6MKX.js → chunk-JRZ4OAAZ.js} +1 -1
  37. package/Marketplace/{chunk-VTFOZMLI.js → chunk-JT76ON64.js} +1 -1
  38. package/Marketplace/{chunk-B4RPQGTA.js → chunk-KKQWPACG.js} +1 -1
  39. package/Marketplace/{chunk-KX7WACSK.js → chunk-LICL6LNZ.js} +1 -1
  40. package/Marketplace/{chunk-FWCMOK42.js → chunk-LWR5YJ24.js} +1 -1
  41. package/Marketplace/chunk-LZR6F2JE.js +1 -0
  42. package/Marketplace/{chunk-TMUAQXEK.js → chunk-MB6PCQRT.js} +1 -1
  43. package/Marketplace/{chunk-3TM7EKQZ.js → chunk-MYMGFQII.js} +1 -1
  44. package/Marketplace/{chunk-Q7FH7Z7R.js → chunk-NNYMQPRT.js} +1 -1
  45. package/Marketplace/{chunk-AIZ2SLGZ.js → chunk-NV3T3OZB.js} +1 -1
  46. package/Marketplace/{chunk-UNZLFKB2.js → chunk-OGJ6YVG4.js} +1 -1
  47. package/Marketplace/{chunk-45IJGKR3.js → chunk-OI7LGMDP.js} +1 -1
  48. package/Marketplace/{chunk-S65ISV4X.js → chunk-Q4Y764AE.js} +1 -1
  49. package/Marketplace/{chunk-TBY7FO23.js → chunk-QJKKB3RG.js} +1 -1
  50. package/Marketplace/{chunk-ECB4VT3U.js → chunk-QSO3ASFL.js} +1 -1
  51. package/Marketplace/{chunk-HWOBJ4Z3.js → chunk-QV22VQ5Q.js} +1 -1
  52. package/Marketplace/{chunk-BELWZRNY.js → chunk-R3VPTXDH.js} +1 -1
  53. package/Marketplace/{chunk-Z2ABDS6L.js → chunk-RHM4GQMX.js} +1 -1
  54. package/Marketplace/{chunk-5DVM7TJ7.js → chunk-RS52HOKA.js} +1 -1
  55. package/Marketplace/{chunk-NZBQKND7.js → chunk-S7ANPM6L.js} +1 -1
  56. package/Marketplace/{chunk-GIFWICGN.js → chunk-TEEFXPWJ.js} +1 -1
  57. package/Marketplace/{chunk-7Y73MGEU.js → chunk-TIXJK5ZY.js} +1 -1
  58. package/Marketplace/{chunk-PQGHN52M.js → chunk-UUMW24BF.js} +1 -1
  59. package/Marketplace/chunk-VMRMDMBE.js +1 -0
  60. package/Marketplace/{chunk-5DS4AFTV.js → chunk-XDPBTCKN.js} +1 -1
  61. package/Marketplace/{chunk-TJRQ2WWD.js → chunk-XQTL4ELH.js} +1 -1
  62. package/Marketplace/{chunk-GD6CRVOV.js → chunk-YHWXRXON.js} +1 -1
  63. package/Marketplace/{chunk-TNVZKPJP.js → chunk-YIB32JAF.js} +1 -1
  64. package/Marketplace/{chunk-5JZJC54P.js → chunk-YZHBBFDR.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-B2AQI7UJ.js → main-KZQ55EQA.js} +1 -1
  67. package/package.json +1 -1
  68. package/Marketplace/chunk-CS64SQAA.js +0 -1
  69. package/Marketplace/chunk-ISBEY2N5.js +0 -1
  70. /package/Marketplace/{chunk-LJ6J4EIT.js → chunk-2XMJ7C47.js} +0 -0
  71. /package/Marketplace/{chunk-CWG6UUW5.js → chunk-GAMNBDJD.js} +0 -0
  72. /package/Marketplace/{chunk-7DXQ5BDE.js → chunk-IFHFFP4S.js} +0 -0
  73. /package/Marketplace/{chunk-N76YHCQ6.js → chunk-J3NU4TSW.js} +0 -0
  74. /package/Marketplace/{chunk-KEKROO5B.js → chunk-TZ6CWMER.js} +0 -0
  75. /package/Marketplace/{polyfills-KQQO3SZT.js → polyfills-OSLX3UYW.js} +0 -0
  76. /package/Marketplace/{styles-WZSIIWL7.css → styles-LDNPEPLO.css} +0 -0
@@ -1 +1 @@
1
- import{$ as lt,$a as G,E as rt,Ea as a,Fa as C,Ja as L,Ma as O,Na as r,Nb as R,Oa as D,Qa as v,Ta as A,Tb as J,Ya as p,Yb as Y,Za as g,_ as I,_a as M,aa as ct,ab as $,b as nt,ba as f,c as _,ca as w,cb as U,da as P,ea as ut,eb as mt,gb as H,hc as ft,ia as V,ib as u,j as ot,ja as z,ob as T,oc as vt,p as at,qa as ht,qb as b,qc as gt,ra as E,rc as K,tb as q,uc as N,vc as j,wa as dt,xa as Z,xc as Q,za as pt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-FWCMOK42.js";import{a as d,b as y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-N76YHCQ6.js";var Tt=["toast-component",""];function xt(s,n){if(s&1){let e=U();p(0,"button",5),H("click",function(){V(e);let i=u();return z(i.remove())}),p(1,"span",6),T(2,"\xD7"),g()()}}function Ot(s,n){if(s&1&&(G(0),T(1),$()),s&2){let e=u(2);a(1),b("[",e.duplicatesCount+1,"]")}}function Dt(s,n){if(s&1&&(p(0,"div"),T(1),A(2,Ot,2,1,"ng-container",4),g()),s&2){let e=u();v(e.options.titleClass),O("aria-label",e.title),a(1),b(" ",e.title," "),a(1),r("ngIf",e.duplicatesCount)}}function At(s,n){if(s&1&&M(0,"div",7),s&2){let e=u();v(e.options.messageClass),r("innerHTML",e.message,Z)}}function Mt(s,n){if(s&1&&(p(0,"div",8),T(1),g()),s&2){let e=u();v(e.options.messageClass),O("aria-label",e.message),a(1),b(" ",e.message," ")}}function Ht(s,n){if(s&1&&(p(0,"div"),M(1,"div",9),g()),s&2){let e=u();a(1),D("width",e.width+"%")}}function Et(s,n){if(s&1){let e=U();p(0,"button",5),H("click",function(){V(e);let i=u();return z(i.remove())}),p(1,"span",6),T(2,"\xD7"),g()()}}function Rt(s,n){if(s&1&&(G(0),T(1),$()),s&2){let e=u(2);a(1),b("[",e.duplicatesCount+1,"]")}}function Nt(s,n){if(s&1&&(p(0,"div"),T(1),A(2,Rt,2,1,"ng-container",4),g()),s&2){let e=u();v(e.options.titleClass),O("aria-label",e.title),a(1),b(" ",e.title," "),a(1),r("ngIf",e.duplicatesCount)}}function jt(s,n){if(s&1&&M(0,"div",7),s&2){let e=u();v(e.options.messageClass),r("innerHTML",e.message,Z)}}function St(s,n){if(s&1&&(p(0,"div",8),T(1),g()),s&2){let e=u();v(e.options.messageClass),O("aria-label",e.message),a(1),b(" ",e.message," ")}}function Bt(s,n){if(s&1&&(p(0,"div"),M(1,"div",9),g()),s&2){let e=u();a(1),D("width",e.width+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},X=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new _;_activate=new _;_manualClose=new _;_resetTimeout=new _;_countDuplicate=new _;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},x=class{toastId;config;message;title;toastType;toastRef;_onTap=new _;_onAction=new _;constructor(n,e,t,i,o,h){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=h,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},_t={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Ct=new ct("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ft=(()=>{class s{_document=w(J);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),it=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},kt=(()=>{class s{_overlayContainer=w(Ft);_componentFactoryResolver=w(pt);_appRef=w(R);_document=w(J);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new et(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new it(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),S=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,h){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=h,this.toastrConfig=d(d({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=d(d({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:h}=this.toastrConfig;for(let l of this.toasts){let c=h&&l.title===e;if((!h||c)&&l.message===t)return l.toastRef.onDuplicate(i,o),l}return null}applyConfig(e={}){return d(d({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let h=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&h!==null)return h;this.previousToastMessage=t;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let c=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let B=t;t&&o.enableHtml&&(B=this.sanitizer.sanitize(dt.HTML,t));let m=new tt(c),F=new x(this.index,o,B,i,e,m),bt=[{provide:x,useValue:F}],yt=E.create({providers:bt,parent:this._injector}),It=new W(o.toastComponent,yt),st=c.attach(It,o.newestOnTop);m.componentInstance=st.instance;let k={toastId:this.index,title:i||"",message:t||"",toastRef:m,onShown:m.afterActivate(),onHidden:m.afterClosed(),onTap:F.onTap(),onAction:F.onAction(),portal:st};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{k.toastRef.activate()})),this.toasts.push(k),k}static \u0275fac=function(t){return new(t||s)(f(Ct),f(kt),f(E),f(vt),f(L))};static \u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Pt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";state;get displayStyle(){if(this.state.value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}}}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=y(d({},this.state),{value:"active"}),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width=t/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=y(d({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state.value!=="removed"&&(clearTimeout(this.timeout),this.state=y(d({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state.value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state.value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state.value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(C(S),C(x),C(L))};static \u0275cmp=P({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&H("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(mt("@flyInOut",i.state),v(i.toastClasses),D("display",i.displayStyle))},standalone:!0,features:[q],attrs:Tt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&A(0,xt,3,0,"button",0)(1,Dt,3,5,"div",1)(2,At,1,3,"div",2)(3,Mt,2,4,"div",3)(4,Ht,2,2,"div",4),t&2&&(r("ngIf",i.options.closeButton),a(1),r("ngIf",i.title),a(1),r("ngIf",i.message&&i.options.enableHtml),a(1),r("ngIf",i.message&&!i.options.enableHtml),a(1),r("ngIf",i.options.progressBar))},dependencies:[Y],encapsulation:2,data:{animation:[gt("flyInOut",[j("inactive",N({opacity:0})),j("active",N({opacity:1})),j("removed",N({opacity:0})),Q("inactive => active",K("{{ easeTime }}ms {{ easing }}")),Q("active => removed",K("{{ easeTime }}ms {{ easing }}"))])]}})}return s})(),Vt=y(d({},_t),{toastComponent:Pt}),zt=(s={})=>ht([{provide:Ct,useValue:{default:Vt,config:s}}]),ne=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[zt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=ut({type:s});static \u0275inj=lt({})}return s})();var Zt=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";get displayStyle(){return this.state==="inactive"?"none":null}state="inactive";timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width=t/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state!=="removed"&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(C(S),C(x),C(R))};static \u0275cmp=P({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&H("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(v(i.toastClasses),D("display",i.displayStyle))},standalone:!0,features:[q],attrs:Tt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&A(0,Et,3,0,"button",0)(1,Nt,3,5,"div",1)(2,jt,1,3,"div",2)(3,St,2,4,"div",3)(4,Bt,2,2,"div",4),t&2&&(r("ngIf",i.options.closeButton),a(1),r("ngIf",i.title),a(1),r("ngIf",i.message&&i.options.enableHtml),a(1),r("ngIf",i.message&&!i.options.enableHtml),a(1),r("ngIf",i.options.progressBar))},dependencies:[Y],encapsulation:2})}return s})(),oe=y(d({},_t),{toastComponent:Zt});var ue=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t){return this.http.get(t).pipe(rt(i=>{let o=this.errorMessageHandling(i);return this.toastr.error(o.message!=""?o.message:"An unknown error has occured!",o.header),ot}))}post(t,i,o={},h=1e5){return new nt(l=>{this.http.post(t,i,o).pipe(at(h)).subscribe({next:c=>{l.next(c),l.complete()},error:c=>{if(c.status==200)l.next(c.error.text),l.complete();else{if(!this.unauthorizedErrorHandling(c)&&!Array.isArray(c?.error?.Message)){let m=this.errorMessageHandling(c);this.toastr.error(m.message!=""?m.message:"An unknown error has occured!",m.header,{enableHtml:!0})}l.error(c)}}})})}unauthorizedErrorHandling(t){let i=!1;return t.status==401&&(localStorage.getItem("Token")?window.location.href="/A/Unauthorized/Main/Unauthorized":window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.error.Message&&(t.error.Message.indexOf("Message")!=-1?o=JSON.parse(t.error.Message).Message:o=t.error.Message)):t.message&&(i="API Error - "+t.name,o=t.message),{header:i,message:o}}};n.\u0275fac=function(i){return new(i||n)(f(ft),f(S))},n.\u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{x as a,S as b,Pt as c,ne as d,ue as e};
1
+ import{$ as lt,$a as G,E as rt,Ea as a,Fa as C,Ja as L,Ma as O,Na as r,Nb as R,Oa as D,Qa as v,Ta as A,Tb as J,Ya as p,Yb as Y,Za as g,_ as I,_a as M,aa as ct,ab as $,b as nt,ba as f,c as _,ca as w,cb as U,da as P,ea as ut,eb as mt,gb as H,hc as ft,ia as V,ib as u,j as ot,ja as z,ob as T,oc as vt,p as at,qa as ht,qb as b,qc as gt,ra as E,rc as K,tb as q,uc as N,vc as j,wa as dt,xa as Z,xc as Q,za as pt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";import{a as d,b as y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J3NU4TSW.js";var Tt=["toast-component",""];function xt(s,n){if(s&1){let e=U();p(0,"button",5),H("click",function(){V(e);let i=u();return z(i.remove())}),p(1,"span",6),T(2,"\xD7"),g()()}}function Ot(s,n){if(s&1&&(G(0),T(1),$()),s&2){let e=u(2);a(1),b("[",e.duplicatesCount+1,"]")}}function Dt(s,n){if(s&1&&(p(0,"div"),T(1),A(2,Ot,2,1,"ng-container",4),g()),s&2){let e=u();v(e.options.titleClass),O("aria-label",e.title),a(1),b(" ",e.title," "),a(1),r("ngIf",e.duplicatesCount)}}function At(s,n){if(s&1&&M(0,"div",7),s&2){let e=u();v(e.options.messageClass),r("innerHTML",e.message,Z)}}function Mt(s,n){if(s&1&&(p(0,"div",8),T(1),g()),s&2){let e=u();v(e.options.messageClass),O("aria-label",e.message),a(1),b(" ",e.message," ")}}function Ht(s,n){if(s&1&&(p(0,"div"),M(1,"div",9),g()),s&2){let e=u();a(1),D("width",e.width+"%")}}function Et(s,n){if(s&1){let e=U();p(0,"button",5),H("click",function(){V(e);let i=u();return z(i.remove())}),p(1,"span",6),T(2,"\xD7"),g()()}}function Rt(s,n){if(s&1&&(G(0),T(1),$()),s&2){let e=u(2);a(1),b("[",e.duplicatesCount+1,"]")}}function Nt(s,n){if(s&1&&(p(0,"div"),T(1),A(2,Rt,2,1,"ng-container",4),g()),s&2){let e=u();v(e.options.titleClass),O("aria-label",e.title),a(1),b(" ",e.title," "),a(1),r("ngIf",e.duplicatesCount)}}function jt(s,n){if(s&1&&M(0,"div",7),s&2){let e=u();v(e.options.messageClass),r("innerHTML",e.message,Z)}}function St(s,n){if(s&1&&(p(0,"div",8),T(1),g()),s&2){let e=u();v(e.options.messageClass),O("aria-label",e.message),a(1),b(" ",e.message," ")}}function Bt(s,n){if(s&1&&(p(0,"div"),M(1,"div",9),g()),s&2){let e=u();a(1),D("width",e.width+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},X=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new _;_activate=new _;_manualClose=new _;_resetTimeout=new _;_countDuplicate=new _;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},x=class{toastId;config;message;title;toastType;toastRef;_onTap=new _;_onAction=new _;constructor(n,e,t,i,o,h){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=h,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},_t={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Ct=new ct("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ft=(()=>{class s{_document=w(J);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),it=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},kt=(()=>{class s{_overlayContainer=w(Ft);_componentFactoryResolver=w(pt);_appRef=w(R);_document=w(J);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new et(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new it(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),S=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,h){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=h,this.toastrConfig=d(d({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=d(d({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:h}=this.toastrConfig;for(let l of this.toasts){let c=h&&l.title===e;if((!h||c)&&l.message===t)return l.toastRef.onDuplicate(i,o),l}return null}applyConfig(e={}){return d(d({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let h=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&h!==null)return h;this.previousToastMessage=t;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let c=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let B=t;t&&o.enableHtml&&(B=this.sanitizer.sanitize(dt.HTML,t));let m=new tt(c),F=new x(this.index,o,B,i,e,m),bt=[{provide:x,useValue:F}],yt=E.create({providers:bt,parent:this._injector}),It=new W(o.toastComponent,yt),st=c.attach(It,o.newestOnTop);m.componentInstance=st.instance;let k={toastId:this.index,title:i||"",message:t||"",toastRef:m,onShown:m.afterActivate(),onHidden:m.afterClosed(),onTap:F.onTap(),onAction:F.onAction(),portal:st};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{k.toastRef.activate()})),this.toasts.push(k),k}static \u0275fac=function(t){return new(t||s)(f(Ct),f(kt),f(E),f(vt),f(L))};static \u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Pt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";state;get displayStyle(){if(this.state.value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}}}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=y(d({},this.state),{value:"active"}),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width=t/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=y(d({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state.value!=="removed"&&(clearTimeout(this.timeout),this.state=y(d({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state.value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state.value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state.value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(C(S),C(x),C(L))};static \u0275cmp=P({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&H("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(mt("@flyInOut",i.state),v(i.toastClasses),D("display",i.displayStyle))},standalone:!0,features:[q],attrs:Tt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&A(0,xt,3,0,"button",0)(1,Dt,3,5,"div",1)(2,At,1,3,"div",2)(3,Mt,2,4,"div",3)(4,Ht,2,2,"div",4),t&2&&(r("ngIf",i.options.closeButton),a(1),r("ngIf",i.title),a(1),r("ngIf",i.message&&i.options.enableHtml),a(1),r("ngIf",i.message&&!i.options.enableHtml),a(1),r("ngIf",i.options.progressBar))},dependencies:[Y],encapsulation:2,data:{animation:[gt("flyInOut",[j("inactive",N({opacity:0})),j("active",N({opacity:1})),j("removed",N({opacity:0})),Q("inactive => active",K("{{ easeTime }}ms {{ easing }}")),Q("active => removed",K("{{ easeTime }}ms {{ easing }}"))])]}})}return s})(),Vt=y(d({},_t),{toastComponent:Pt}),zt=(s={})=>ht([{provide:Ct,useValue:{default:Vt,config:s}}]),ne=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[zt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=ut({type:s});static \u0275inj=lt({})}return s})();var Zt=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";get displayStyle(){return this.state==="inactive"?"none":null}state="inactive";timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width=t/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state!=="removed"&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(C(S),C(x),C(R))};static \u0275cmp=P({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&H("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(v(i.toastClasses),D("display",i.displayStyle))},standalone:!0,features:[q],attrs:Tt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&A(0,Et,3,0,"button",0)(1,Nt,3,5,"div",1)(2,jt,1,3,"div",2)(3,St,2,4,"div",3)(4,Bt,2,2,"div",4),t&2&&(r("ngIf",i.options.closeButton),a(1),r("ngIf",i.title),a(1),r("ngIf",i.message&&i.options.enableHtml),a(1),r("ngIf",i.message&&!i.options.enableHtml),a(1),r("ngIf",i.options.progressBar))},dependencies:[Y],encapsulation:2})}return s})(),oe=y(d({},_t),{toastComponent:Zt});var ue=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t){return this.http.get(t).pipe(rt(i=>{let o=this.errorMessageHandling(i);return this.toastr.error(o.message!=""?o.message:"An unknown error has occured!",o.header),ot}))}post(t,i,o={},h=1e5){return new nt(l=>{this.http.post(t,i,o).pipe(at(h)).subscribe({next:c=>{l.next(c),l.complete()},error:c=>{if(c.status==200)l.next(c.error.text),l.complete();else{if(!this.unauthorizedErrorHandling(c)&&!Array.isArray(c?.error?.Message)){let m=this.errorMessageHandling(c);this.toastr.error(m.message!=""?m.message:"An unknown error has occured!",m.header,{enableHtml:!0})}l.error(c)}}})})}unauthorizedErrorHandling(t){let i=!1;return t.status==401&&(localStorage.getItem("Token")?window.location.href="/A/Unauthorized/Main/Unauthorized":window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.error.Message&&(t.error.Message.indexOf("Message")!=-1?o=JSON.parse(t.error.Message).Message:o=t.error.Message)):t.message&&(i="API Error - "+t.name,o=t.message),{header:i,message:o}}};n.\u0275fac=function(i){return new(i||n)(f(ft),f(S))},n.\u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{x as a,S as b,Pt as c,ne as d,ue as e};
@@ -1,4 +1,4 @@
1
- import{a as be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-VTFOZMLI.js";import{a as Se,b as X,c as _e,d as Ce,e as Y,f as Re,g as Q,h as De,i as M,j as ee,k as p}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-YQXKX6O7.js";import{a as Oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-3ICHEZSE.js";import{e as Pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-4O5EV6W4.js";import{c as ye}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-CWG6UUW5.js";import{$ as W,A as Ae,B as ke,Ja as _,Kb as we,Lb as ve,M as Ee,P as q,Pb as J,S as k,T as Z,W as O,_ as S,aa as m,b as L,ba as u,c as fe,ea as H,fc as Ie,g as ge,h as me,k as I,l as y,m as R,n as D,oa as Te,q as P,ta as $}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-FWCMOK42.js";import{h as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-N76YHCQ6.js";var Ze="firebase",Je="10.7.1";M(Ze,Je,"app");var F=new we("ANGULARFIRE2_VERSION");var Xe=(e,r)=>{let n=r?[r]:De(),t=[];return n.forEach(i=>{i.container.getProvider(e).instances.forEach(s=>{t.includes(s)||t.push(s)})}),t},N=class{constructor(){return Xe(Ye)}},Ye="app-check";function te(){}var U=class{zone;delegate;constructor(r,n=me){this.zone=r,this.delegate=n}now(){return this.delegate.now()}schedule(r,n,t){let i=this.zone,o=function(s){i.runGuarded(()=>{r.apply(this,[s])})};return this.delegate.schedule(o,n,t)}},ne=class{zone;task=null;constructor(r){this.zone=r}call(r,n){let t=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",te,{},te,te)),n.pipe(O({next:t,complete:t,error:t})).subscribe(r).add(t)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},Me=(()=>{class e{ngZone;outsideAngular;insideAngular;constructor(n){this.ngZone=n,this.outsideAngular=n.runOutsideAngular(()=>new U(Zone.current)),this.insideAngular=n.run(()=>new U(Zone.current,ge)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(t){return new(t||e)(u(_))};static \u0275prov=S({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Qe(){let e=globalThis.\u0275AngularFireScheduler;if(!e)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
1
+ import{a as be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-JT76ON64.js";import{a as Se,b as X,c as _e,d as Ce,e as Y,f as Re,g as Q,h as De,i as M,j as ee,k as p}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J55273WG.js";import{a as Oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-DE2BZXNA.js";import{e as Pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-BBX2DZWF.js";import{c as ye}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-GAMNBDJD.js";import{$ as W,A as Ae,B as ke,Ja as _,Kb as we,Lb as ve,M as Ee,P as q,Pb as J,S as k,T as Z,W as O,_ as S,aa as m,b as L,ba as u,c as fe,ea as H,fc as Ie,g as ge,h as me,k as I,l as y,m as R,n as D,oa as Te,q as P,ta as $}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";import{h as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J3NU4TSW.js";var Ze="firebase",Je="10.7.1";M(Ze,Je,"app");var F=new we("ANGULARFIRE2_VERSION");var Xe=(e,r)=>{let n=r?[r]:De(),t=[];return n.forEach(i=>{i.container.getProvider(e).instances.forEach(s=>{t.includes(s)||t.push(s)})}),t},N=class{constructor(){return Xe(Ye)}},Ye="app-check";function te(){}var U=class{zone;delegate;constructor(r,n=me){this.zone=r,this.delegate=n}now(){return this.delegate.now()}schedule(r,n,t){let i=this.zone,o=function(s){i.runGuarded(()=>{r.apply(this,[s])})};return this.delegate.schedule(o,n,t)}},ne=class{zone;task=null;constructor(r){this.zone=r}call(r,n){let t=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",te,{},te,te)),n.pipe(O({next:t,complete:t,error:t})).subscribe(r).add(t)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},Me=(()=>{class e{ngZone;outsideAngular;insideAngular;constructor(n){this.ngZone=n,this.outsideAngular=n.runOutsideAngular(()=>new U(Zone.current)),this.insideAngular=n.run(()=>new U(Zone.current,ge)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(t){return new(t||e)(u(_))};static \u0275prov=S({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Qe(){let e=globalThis.\u0275AngularFireScheduler;if(!e)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
2
2
  provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return e}function Ne(e){return et(Qe())(e)}function et(e){return function(n){return n=n.lift(new ne(e.ngZone)),n.pipe(y(e.outsideAngular),I(e.insideAngular))}}var nt="firebase",rt="10.7.1";p.registerVersion(nt,rt,"app-compat");var it=["ngOnDestroy"],xe=(e,r,n,t={})=>new Proxy(e,{get:(i,o)=>n.runOutsideAngular(()=>{if(e[o])return t?.spy?.get&&t.spy.get(o,e[o]),e[o];if(it.indexOf(o)>-1)return()=>{};let s=r.toPromise().then(c=>{let a=c?.[o];return typeof a=="function"?a.bind(c):a?.then?a.then(d=>n.run(()=>d)):n.run(()=>a)});return new Proxy(()=>{},{get:(c,a)=>s[a],apply:(c,a,d)=>s.then(g=>{let b=g?.(...d);return t?.spy?.apply&&t.spy.apply(o,d,b),b})})})});var z=class{constructor(r){return r}},B=new m("angularfire2.app.options"),K=new m("angularfire2.app.name");function ie(e,r,n){let t=typeof n=="string"&&n||"[DEFAULT]",i=typeof n=="object"&&n||{};i.name=i.name||t;let s=p.apps.filter(c=>c&&c.name===i.name)[0]||r.runOutsideAngular(()=>p.initializeApp(e,i));try{if(JSON.stringify(e)!==JSON.stringify(s.options)){let c=!!module.hot;ot("error",`${s.name} Firebase App already initialized with different options${c?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new z(s)}var ot=(e,...r)=>{J()&&typeof console<"u"&&console[e](...r)},st={provide:z,useFactory:ie,deps:[B,_,[new Te,K]]},an=(()=>{class e{static initializeApp(n,t){return{ngModule:e,providers:[{provide:B,useValue:n},{provide:K,useValue:t}]}}constructor(n){p.registerVersion("angularfire",F.full,"core"),p.registerVersion("angularfire",F.full,"app-compat"),p.registerVersion("angular",ve.full,n.toString())}static \u0275fac=function(t){return new(t||e)(u($))};static \u0275mod=H({type:e});static \u0275inj=W({providers:[st]})}return e})();function je(e,r,n,t,i){let[,o,s]=globalThis.\u0275AngularfireInstanceCache.find(c=>c[0]===e)||[];if(o)return at(i,s)||(Fe("error",`${r} was already initialized on the ${n} Firebase App with different settings.${ct?" You may need to reload as Firebase is not HMR aware.":""}`),Fe("warn",{is:i,was:s})),o;{let c=t();return globalThis.\u0275AngularfireInstanceCache.push([e,c,i]),c}}function at(e,r){try{return e.toString()===r.toString()}catch{return e===r}}var ct=typeof module<"u"&&!!module.hot,Fe=(e,...r)=>{J()&&typeof console<"u"&&console[e](...r)};globalThis.\u0275AngularfireInstanceCache||=[];var ut=new Map,lt={activated:!1,tokenObservers:[]},dt={initialized:!1,enabled:!1};function f(e){return ut.get(e)||Object.assign({},lt)}function Ue(){return dt}var ht="https://content-firebaseappcheck.googleapis.com/v1";var pt="exchangeDebugToken",Le={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Tn=24*60*60*1e3;var se=class{constructor(r,n,t,i,o){if(this.operation=r,this.retryPolicy=n,this.getWaitDuration=t,this.lowerBound=i,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=i,i>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(r){return T(this,null,function*(){this.stop();try{this.pending=new X,this.pending.promise.catch(n=>{}),yield ft(this.getNextRun(r)),this.pending.resolve(),yield this.pending.promise,this.pending=new X,this.pending.promise.catch(n=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(n){this.retryPolicy(n)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(r){if(r)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let n=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),n}}};function ft(e){return new Promise(r=>{setTimeout(r,e)})}var gt={"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.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},w=new Ce("appCheck","AppCheck",gt);function ze(e){if(!f(e).activated)throw w.create("use-before-activation",{appName:e.name})}function Be(t,i){return T(this,arguments,function*({url:e,body:r},n){let o={"Content-Type":"application/json"},s=n.getImmediate({optional:!0});if(s){let h=yield s.getHeartbeatsHeader();h&&(o["X-Firebase-Client"]=h)}let c={method:"POST",body:JSON.stringify(r),headers:o},a;try{a=yield fetch(e,c)}catch(h){throw w.create("fetch-network-error",{originalErrorMessage:h?.message})}if(a.status!==200)throw w.create("fetch-status-error",{httpStatus:a.status});let d;try{d=yield a.json()}catch(h){throw w.create("fetch-parse-error",{originalErrorMessage:h?.message})}let g=d.ttl.match(/^([\d.]+)(s)$/);if(!g||!g[2]||isNaN(Number(g[1])))throw w.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${d.ttl}`});let b=Number(g[1])*1e3,j=Date.now();return{token:d.token,expireTimeMillis:j+b,issuedAtTimeMillis:j}})}function Ke(e,r){let{projectId:n,appId:t,apiKey:i}=e.options;return{url:`${ht}/projects/${n}/apps/${t}:${pt}?key=${i}`,body:{debug_token:r}}}var mt="firebase-app-check-database",At=1,ae="firebase-app-check-store";var V=null;function kt(){return V||(V=new Promise((e,r)=>{try{let n=indexedDB.open(mt,At);n.onsuccess=t=>{e(t.target.result)},n.onerror=t=>{var i;r(w.create("storage-open",{originalErrorMessage:(i=t.target.error)===null||i===void 0?void 0:i.message}))},n.onupgradeneeded=t=>{let i=t.target.result;switch(t.oldVersion){case 0:i.createObjectStore(ae,{keyPath:"compositeKey"})}}}catch(n){r(w.create("storage-open",{originalErrorMessage:n?.message}))}}),V)}function Et(e,r){return Tt(wt(e),r)}function Tt(e,r){return T(this,null,function*(){let t=(yield kt()).transaction(ae,"readwrite"),o=t.objectStore(ae).put({compositeKey:e,value:r});return new Promise((s,c)=>{o.onsuccess=a=>{s()},t.onerror=a=>{var d;c(w.create("storage-set",{originalErrorMessage:(d=a.target.error)===null||d===void 0?void 0:d.message}))}})})}function wt(e){return`${e.options.appId}-${e.name}`}var ce=new Re("@firebase/app-check");function oe(e,r){return _e()?Et(e,r).catch(n=>{ce.warn(`Failed to write token to IndexedDB. Error: ${n}`)}):Promise.resolve()}function Ve(){return Ue().enabled}function Ge(){return T(this,null,function*(){let e=Ue();if(e.enabled&&e.token)return e.token.promise;throw Error(`
3
3
  Can't get debug token in production mode.
4
- `)})}var vt={error:"UNKNOWN_ERROR"};function It(e){return Se.encodeString(JSON.stringify(e),!1)}function ue(e,r=!1){return T(this,null,function*(){let n=e.app;ze(n);let t=f(n),i=t.token,o;if(i&&!x(i)&&(t.token=void 0,i=void 0),!i){let a=yield t.cachedTokenPromise;a&&(x(a)?i=a:yield oe(n,void 0))}if(!r&&i&&x(i))return{token:i.token};let s=!1;if(Ve()){t.exchangeTokenPromise||(t.exchangeTokenPromise=Be(Ke(n,yield Ge()),e.heartbeatServiceProvider).finally(()=>{t.exchangeTokenPromise=void 0}),s=!0);let a=yield t.exchangeTokenPromise;return yield oe(n,a),t.token=a,{token:a.token}}try{t.exchangeTokenPromise||(t.exchangeTokenPromise=t.provider.getToken().finally(()=>{t.exchangeTokenPromise=void 0}),s=!0),i=yield f(n).exchangeTokenPromise}catch(a){a.code==="appCheck/throttled"?ce.warn(a.message):ce.error(a),o=a}let c;return i?o?x(i)?c={token:i.token,internalError:o}:c=He(o):(c={token:i.token},t.token=i,yield oe(n,i)):c=He(o),s&&St(n,c),c})}function Pt(e){return T(this,null,function*(){let r=e.app;ze(r);let{provider:n}=f(r);if(Ve()){let t=yield Ge(),{token:i}=yield Be(Ke(r,t),e.heartbeatServiceProvider);return{token:i}}else{let{token:t}=yield n.getToken();return{token:t}}})}function bt(e,r,n,t){let{app:i}=e,o=f(i),s={next:n,error:t,type:r};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&x(o.token)){let c=o.token;Promise.resolve().then(()=>{n({token:c.token}),We(e)}).catch(()=>{})}o.cachedTokenPromise.then(()=>We(e))}function qe(e,r){let n=f(e),t=n.tokenObservers.filter(i=>i.next!==r);t.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=t}function We(e){let{app:r}=e,n=f(r),t=n.tokenRefresher;t||(t=yt(e),n.tokenRefresher=t),!t.isRunning()&&n.isTokenAutoRefreshEnabled&&t.start()}function yt(e){let{app:r}=e;return new se(()=>T(this,null,function*(){let n=f(r),t;if(n.token?t=yield ue(e,!0):t=yield ue(e),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let n=f(r);if(n.token){let t=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5,i=n.token.expireTimeMillis-5*60*1e3;return t=Math.min(t,i),Math.max(0,t-Date.now())}else return 0},Le.RETRIAL_MIN_WAIT,Le.RETRIAL_MAX_WAIT)}function St(e,r){let n=f(e).tokenObservers;for(let t of n)try{t.type==="EXTERNAL"&&r.error!=null?t.error(r.error):t.next(r)}catch{}}function x(e){return e.expireTimeMillis-Date.now()>0}function He(e){return{token:It(vt),error:e}}var le=class{constructor(r,n){this.app=r,this.heartbeatServiceProvider=n}_delete(){let{tokenObservers:r}=f(this.app);for(let n of r)qe(this.app,n.next);return Promise.resolve()}};function _t(e,r){return new le(e,r)}function Ct(e){return{getToken:r=>ue(e,r),getLimitedUseToken:()=>Pt(e),addTokenListener:r=>bt(e,"INTERNAL",r),removeTokenListener:r=>qe(e.app,r)}}var Rt="@firebase/app-check",Dt="0.8.1";var Ot="app-check",$e="app-check-internal";function Mt(){Q(new Y(Ot,e=>{let r=e.getProvider("app").getImmediate(),n=e.getProvider("heartbeat");return _t(r,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,r,n)=>{e.getProvider($e).initialize()})),Q(new Y($e,e=>{let r=e.getProvider("app-check").getImmediate();return Ct(r)},"PUBLIC").setInstantiationMode("EXPLICIT")),M(Rt,Dt)}Mt();var Nt=["localhost","0.0.0.0","127.0.0.1"],On=typeof window<"u"&&Nt.includes(window.location.hostname);var xt=new m("angularfire2.auth.use-emulator"),jt=new m("angularfire2.auth.settings"),Lt=new m("angularfire2.auth.tenant-id"),Wt=new m("angularfire2.auth.langugage-code"),Ht=new m("angularfire2.auth.use-device-language"),$t=new m("angularfire.auth.persistence"),Ut=(e,r,n,t,i,o,s,c)=>je(`${e.name}.auth`,"AngularFireAuth",e.name,()=>{let a=r.runOutsideAngular(()=>e.auth());if(n&&a.useEmulator(...n),t&&(a.tenantId=t),a.languageCode=i,o&&a.useDeviceLanguage(),s)for(let[d,g]of Object.entries(s))a.settings[d]=g;return c&&a.setPersistence(c),a},[n,t,i,o,s,c]),de=(()=>{class e{authState;idToken;user;idTokenResult;credential;constructor(n,t,i,o,s,c,a,d,g,b,j,h){let he=new fe,C=D(void 0).pipe(I(s.outsideAngular),k(()=>o.runOutsideAngular(()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-ISBEY2N5.js"))),P(()=>ie(n,o,t)),P(E=>Ut(E,o,c,d,g,b,a,j)),q({bufferSize:1,refCount:!1}));if(Ie(i))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=D(null);else{C.pipe(Ee()).subscribe();let E=C.pipe(k(l=>l.getRedirectResult().then(A=>A,()=>null)),Ne,q({bufferSize:1,refCount:!1})),pe=C.pipe(k(l=>new L(A=>({unsubscribe:o.runOutsideAngular(()=>l.onAuthStateChanged(v=>A.next(v),v=>A.error(v),()=>A.complete()))})))),G=C.pipe(k(l=>new L(A=>({unsubscribe:o.runOutsideAngular(()=>l.onIdTokenChanged(v=>A.next(v),v=>A.error(v),()=>A.complete()))}))));this.authState=E.pipe(Z(pe),y(s.outsideAngular),I(s.insideAngular)),this.user=E.pipe(Z(G),y(s.outsideAngular),I(s.insideAngular)),this.idToken=this.user.pipe(k(l=>l?R(l.getIdToken()):D(null))),this.idTokenResult=this.user.pipe(k(l=>l?R(l.getIdTokenResult()):D(null))),this.credential=Ae(E,he,this.authState.pipe(ke(l=>!l))).pipe(P(l=>l?.user?l:null),y(s.outsideAngular),I(s.insideAngular))}return xe(this,C,o,{spy:{apply:(E,pe,G)=>{(E.startsWith("signIn")||E.startsWith("createUser"))&&G.then(l=>he.next(l))}}})}static \u0275fac=function(t){return new(t||e)(u(B),u(K,8),u($),u(_),u(Me),u(xt,8),u(jt,8),u(Lt,8),u(Wt,8),u(Ht,8),u($t,8),u(N,8))};static \u0275prov=S({token:e,factory:e.\u0275fac,providedIn:"any"})}return e})(),qn=(()=>{class e{constructor(){p.registerVersion("angularfire",F.full,"auth-compat")}static \u0275fac=function(t){return new(t||e)};static \u0275mod=H({type:e});static \u0275inj=W({providers:[de]})}return e})();var xi=(()=>{let r=class r{constructor(t,i,o,s){this.httpService=t,this.tokenDecodeService=i,this.afAuth=o,this.ngxPermission=s}login(t){return this.httpService.post("/api/token/Login",t).pipe(O(i=>{this.setLocalStorage(i,t.Host,t.Username),this.loadPermissions()}))}loginWithGoogle(t,i){t.preventDefault();let o=new ee;return o.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(o)).pipe(P(s=>s.credential),P(s=>s.idToken),k(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:i}))),O(s=>{this.setLocalStorage(s,i,null),this.loadPermissions()}))}setLocalStorage(t,i,o){localStorage.setItem("user",JSON.stringify(t)),localStorage.setItem("Authorization",JSON.stringify({Host:i,username:o})),localStorage.setItem("Intercom",JSON.stringify(t.IntercomWidget))}loadPermissions(){this.ngxPermission.loadPermissions([]);let t=localStorage.getItem("user");if(ye.IsNotEmpty(t)){let i=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(i)}}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let t=JSON.parse(window.localStorage.getItem("user")),i=new Date;if(t!=null){let o=new Date(t.Token.expiredAt);return i<o?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let t=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(t).Host}return this.domain}clearLocalStorage(){localStorage.removeItem("Intercom"),localStorage.removeItem("Authorization"),localStorage.removeItem("user")}};r.\u0275fac=function(i){return new(i||r)(u(Pe),u(be),u(de),u(Oe))},r.\u0275prov=S({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})();export{an as a,qn as b,xi as c};
4
+ `)})}var vt={error:"UNKNOWN_ERROR"};function It(e){return Se.encodeString(JSON.stringify(e),!1)}function ue(e,r=!1){return T(this,null,function*(){let n=e.app;ze(n);let t=f(n),i=t.token,o;if(i&&!x(i)&&(t.token=void 0,i=void 0),!i){let a=yield t.cachedTokenPromise;a&&(x(a)?i=a:yield oe(n,void 0))}if(!r&&i&&x(i))return{token:i.token};let s=!1;if(Ve()){t.exchangeTokenPromise||(t.exchangeTokenPromise=Be(Ke(n,yield Ge()),e.heartbeatServiceProvider).finally(()=>{t.exchangeTokenPromise=void 0}),s=!0);let a=yield t.exchangeTokenPromise;return yield oe(n,a),t.token=a,{token:a.token}}try{t.exchangeTokenPromise||(t.exchangeTokenPromise=t.provider.getToken().finally(()=>{t.exchangeTokenPromise=void 0}),s=!0),i=yield f(n).exchangeTokenPromise}catch(a){a.code==="appCheck/throttled"?ce.warn(a.message):ce.error(a),o=a}let c;return i?o?x(i)?c={token:i.token,internalError:o}:c=He(o):(c={token:i.token},t.token=i,yield oe(n,i)):c=He(o),s&&St(n,c),c})}function Pt(e){return T(this,null,function*(){let r=e.app;ze(r);let{provider:n}=f(r);if(Ve()){let t=yield Ge(),{token:i}=yield Be(Ke(r,t),e.heartbeatServiceProvider);return{token:i}}else{let{token:t}=yield n.getToken();return{token:t}}})}function bt(e,r,n,t){let{app:i}=e,o=f(i),s={next:n,error:t,type:r};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&x(o.token)){let c=o.token;Promise.resolve().then(()=>{n({token:c.token}),We(e)}).catch(()=>{})}o.cachedTokenPromise.then(()=>We(e))}function qe(e,r){let n=f(e),t=n.tokenObservers.filter(i=>i.next!==r);t.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=t}function We(e){let{app:r}=e,n=f(r),t=n.tokenRefresher;t||(t=yt(e),n.tokenRefresher=t),!t.isRunning()&&n.isTokenAutoRefreshEnabled&&t.start()}function yt(e){let{app:r}=e;return new se(()=>T(this,null,function*(){let n=f(r),t;if(n.token?t=yield ue(e,!0):t=yield ue(e),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let n=f(r);if(n.token){let t=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5,i=n.token.expireTimeMillis-5*60*1e3;return t=Math.min(t,i),Math.max(0,t-Date.now())}else return 0},Le.RETRIAL_MIN_WAIT,Le.RETRIAL_MAX_WAIT)}function St(e,r){let n=f(e).tokenObservers;for(let t of n)try{t.type==="EXTERNAL"&&r.error!=null?t.error(r.error):t.next(r)}catch{}}function x(e){return e.expireTimeMillis-Date.now()>0}function He(e){return{token:It(vt),error:e}}var le=class{constructor(r,n){this.app=r,this.heartbeatServiceProvider=n}_delete(){let{tokenObservers:r}=f(this.app);for(let n of r)qe(this.app,n.next);return Promise.resolve()}};function _t(e,r){return new le(e,r)}function Ct(e){return{getToken:r=>ue(e,r),getLimitedUseToken:()=>Pt(e),addTokenListener:r=>bt(e,"INTERNAL",r),removeTokenListener:r=>qe(e.app,r)}}var Rt="@firebase/app-check",Dt="0.8.1";var Ot="app-check",$e="app-check-internal";function Mt(){Q(new Y(Ot,e=>{let r=e.getProvider("app").getImmediate(),n=e.getProvider("heartbeat");return _t(r,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,r,n)=>{e.getProvider($e).initialize()})),Q(new Y($e,e=>{let r=e.getProvider("app-check").getImmediate();return Ct(r)},"PUBLIC").setInstantiationMode("EXPLICIT")),M(Rt,Dt)}Mt();var Nt=["localhost","0.0.0.0","127.0.0.1"],On=typeof window<"u"&&Nt.includes(window.location.hostname);var xt=new m("angularfire2.auth.use-emulator"),jt=new m("angularfire2.auth.settings"),Lt=new m("angularfire2.auth.tenant-id"),Wt=new m("angularfire2.auth.langugage-code"),Ht=new m("angularfire2.auth.use-device-language"),$t=new m("angularfire.auth.persistence"),Ut=(e,r,n,t,i,o,s,c)=>je(`${e.name}.auth`,"AngularFireAuth",e.name,()=>{let a=r.runOutsideAngular(()=>e.auth());if(n&&a.useEmulator(...n),t&&(a.tenantId=t),a.languageCode=i,o&&a.useDeviceLanguage(),s)for(let[d,g]of Object.entries(s))a.settings[d]=g;return c&&a.setPersistence(c),a},[n,t,i,o,s,c]),de=(()=>{class e{authState;idToken;user;idTokenResult;credential;constructor(n,t,i,o,s,c,a,d,g,b,j,h){let he=new fe,C=D(void 0).pipe(I(s.outsideAngular),k(()=>o.runOutsideAngular(()=>import("https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LZR6F2JE.js"))),P(()=>ie(n,o,t)),P(E=>Ut(E,o,c,d,g,b,a,j)),q({bufferSize:1,refCount:!1}));if(Ie(i))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=D(null);else{C.pipe(Ee()).subscribe();let E=C.pipe(k(l=>l.getRedirectResult().then(A=>A,()=>null)),Ne,q({bufferSize:1,refCount:!1})),pe=C.pipe(k(l=>new L(A=>({unsubscribe:o.runOutsideAngular(()=>l.onAuthStateChanged(v=>A.next(v),v=>A.error(v),()=>A.complete()))})))),G=C.pipe(k(l=>new L(A=>({unsubscribe:o.runOutsideAngular(()=>l.onIdTokenChanged(v=>A.next(v),v=>A.error(v),()=>A.complete()))}))));this.authState=E.pipe(Z(pe),y(s.outsideAngular),I(s.insideAngular)),this.user=E.pipe(Z(G),y(s.outsideAngular),I(s.insideAngular)),this.idToken=this.user.pipe(k(l=>l?R(l.getIdToken()):D(null))),this.idTokenResult=this.user.pipe(k(l=>l?R(l.getIdTokenResult()):D(null))),this.credential=Ae(E,he,this.authState.pipe(ke(l=>!l))).pipe(P(l=>l?.user?l:null),y(s.outsideAngular),I(s.insideAngular))}return xe(this,C,o,{spy:{apply:(E,pe,G)=>{(E.startsWith("signIn")||E.startsWith("createUser"))&&G.then(l=>he.next(l))}}})}static \u0275fac=function(t){return new(t||e)(u(B),u(K,8),u($),u(_),u(Me),u(xt,8),u(jt,8),u(Lt,8),u(Wt,8),u(Ht,8),u($t,8),u(N,8))};static \u0275prov=S({token:e,factory:e.\u0275fac,providedIn:"any"})}return e})(),qn=(()=>{class e{constructor(){p.registerVersion("angularfire",F.full,"auth-compat")}static \u0275fac=function(t){return new(t||e)};static \u0275mod=H({type:e});static \u0275inj=W({providers:[de]})}return e})();var xi=(()=>{let r=class r{constructor(t,i,o,s){this.httpService=t,this.tokenDecodeService=i,this.afAuth=o,this.ngxPermission=s}login(t){return this.httpService.post("/api/token/Login",t).pipe(O(i=>{this.setLocalStorage(i,t.Host,t.Username),this.loadPermissions()}))}loginWithGoogle(t,i){t.preventDefault();let o=new ee;return o.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(o)).pipe(P(s=>s.credential),P(s=>s.idToken),k(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:i}))),O(s=>{this.setLocalStorage(s,i,null),this.loadPermissions()}))}setLocalStorage(t,i,o){localStorage.setItem("user",JSON.stringify(t)),localStorage.setItem("Authorization",JSON.stringify({Host:i,username:o})),localStorage.setItem("Intercom",JSON.stringify(t.IntercomWidget))}loadPermissions(){this.ngxPermission.loadPermissions([]);let t=localStorage.getItem("user");if(ye.IsNotEmpty(t)){let i=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(i)}}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let t=JSON.parse(window.localStorage.getItem("user")),i=new Date;if(t!=null){let o=new Date(t.Token.expiredAt);return i<o?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let t=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(t).Host}return this.domain}clearLocalStorage(){localStorage.removeItem("Intercom"),localStorage.removeItem("Authorization"),localStorage.removeItem("user")}};r.\u0275fac=function(i){return new(i||r)(u(Pe),u(be),u(de),u(Oe))},r.\u0275prov=S({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})();export{an as a,qn as b,xi as c};
@@ -1,4 +1,4 @@
1
- import{a as ee,b as ne,c as ie,d as oe,e as re,f as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-B4RPQGTA.js";import{b as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-5DS4AFTV.js";import{c as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-MA4ZKUP6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-VTFOZMLI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-YQXKX6O7.js";import{a as Y,b as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-45IJGKR3.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-3ICHEZSE.js";import{e as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-4O5EV6W4.js";import{a as J}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-GMALFTAY.js";import{v as Q,w as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-5JZJC54P.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-LKSBRXCX.js";import{c as W,h as z,k as G,u as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-PQGHN52M.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-CWG6UUW5.js";import{$ as N,$a as u,Ea as l,Fa as E,Fc as H,Hc as j,Ia as O,Jc as $,Na as p,Ta as c,Xb as w,Ya as o,Yb as R,Za as a,Zb as P,_ as T,_a as d,ab as f,ba as U,cb as y,da as h,dc as A,ea as k,gb as _,ia as S,ib as g,ja as v,nb as C,ob as m,pb as F,qb as L,sb as B,vb as b,xa as M}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-FWCMOK42.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-N76YHCQ6.js";var de=e=>[e];function ue(e,t){if(e&1&&(u(0),o(1,"a",9),m(2),a(),f()),e&2){let s=t.$implicit;l(1),p("routerLink",b(2,de,s.url)),l(1),L(" ",s.title,"")}}var pe=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=h({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,r){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),a()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),a(),o(8,"div",6)(9,"div",7),c(10,ue,3,4,"ng-container",8),a()()()()(),d(11,"router-outlet")),i&2&&(l(3),p("Tabs",r.tabs),l(7),p("ngForOf",r.moreMenu))},dependencies:[w,Y,H,j]});let e=t;return e})();var I=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){let i="/api/Product/downloadurl";return this.httpService.post(i,n)}};t.\u0275fac=function(i){return new(i||t)(U(V))},t.\u0275prov=T({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function ge(e,t){if(e&1&&(o(0,"th"),m(1),a()),e&2){let s=t.$implicit;l(1),F(s.column)}}function _e(e,t){if(e&1&&(u(0),o(1,"td"),d(2,"span",6),a(),f()),e&2){let s=t.$implicit,n=g().$implicit;l(2),p("innerHTML",n[s.prop],M)}}var he=e=>({"background-color":e});function Se(e,t){if(e&1&&(o(0,"tr",5),c(1,_e,3,1,"ng-container",3),a()),e&2){let s=t.$implicit,n=g();p("ngStyle",b(2,he,s.Status>200?"#F4D6D5":"#DEE9C9")),l(1),p("ngForOf",n.configs)}}var se=(()=>{let t=class t{constructor(){this.eventClose=new O}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=h({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,r){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ge,2,1,"th",3),a()(),o(5,"tbody"),c(6,Se,2,4,"tr",4),a()()()),i&2&&(l(4),p("ngForOf",r.configs),l(2),p("ngForOf",r.data))},dependencies:[w,P]});let e=t;return e})();function ye(e,t){if(e&1){let s=y();u(0),o(1,"button",23),_("click",function(){S(s);let i=g(),r=C(11);return v(i.onNewStepperState(r))}),d(2,"i",24),m(3," New "),a(),f()}}function Ce(e,t){if(e&1){let s=y();u(0),o(1,"button",23),_("click",function(){S(s),g();let i=C(11);return v(i.previous())}),m(2," Back "),a(),f()}}function be(e,t){if(e&1){let s=y();u(0),o(1,"button",25),_("click",function(){S(s);let i=g(),r=C(11);return v(i.onStepperNext(r))}),m(2," Next "),a(),f()}}function we(e,t){if(e&1){let s=y();u(0),o(1,"button",26),_("click",function(){S(s);let i=g(),r=C(11);return v(i.onSubmit(r))}),m(2,"Download"),a(),f()}if(e&2){let s=g();l(1),p("disabled",!s.urls)}}function xe(e,t){e&1&&m(0,"Instruction")}function Ie(e,t){e&1&&m(0,"Download")}function De(e,t){e&1&&m(0,"Finish")}function Ee(e,t){e&1&&d(0,"i",27)}function Te(e,t){e&1&&d(0,"i",28)}function Ne(e,t){e&1&&d(0,"i",29)}var me=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as ee,b as ne,c as ie,d as oe,e as re,f as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-KKQWPACG.js";import{b as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-XDPBTCKN.js";import{c as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-BLRV33OB.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-JT76ON64.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J55273WG.js";import{a as Y,b as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-OI7LGMDP.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-DE2BZXNA.js";import{e as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-BBX2DZWF.js";import{a as J}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-2QO2D23V.js";import{v as Q,w as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-YZHBBFDR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-32YQ5ZBK.js";import{c as W,h as z,k as G,u as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-UUMW24BF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-GAMNBDJD.js";import{$ as N,$a as u,Ea as l,Fa as E,Fc as H,Hc as j,Ia as O,Jc as $,Na as p,Ta as c,Xb as w,Ya as o,Yb as R,Za as a,Zb as P,_ as T,_a as d,ab as f,ba as U,cb as y,da as h,dc as A,ea as k,gb as _,ia as S,ib as g,ja as v,nb as C,ob as m,pb as F,qb as L,sb as B,vb as b,xa as M}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J3NU4TSW.js";var de=e=>[e];function ue(e,t){if(e&1&&(u(0),o(1,"a",9),m(2),a(),f()),e&2){let s=t.$implicit;l(1),p("routerLink",b(2,de,s.url)),l(1),L(" ",s.title,"")}}var pe=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=h({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,r){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),a()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),a(),o(8,"div",6)(9,"div",7),c(10,ue,3,4,"ng-container",8),a()()()()(),d(11,"router-outlet")),i&2&&(l(3),p("Tabs",r.tabs),l(7),p("ngForOf",r.moreMenu))},dependencies:[w,Y,H,j]});let e=t;return e})();var I=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){let i="/api/Product/downloadurl";return this.httpService.post(i,n)}};t.\u0275fac=function(i){return new(i||t)(U(V))},t.\u0275prov=T({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function ge(e,t){if(e&1&&(o(0,"th"),m(1),a()),e&2){let s=t.$implicit;l(1),F(s.column)}}function _e(e,t){if(e&1&&(u(0),o(1,"td"),d(2,"span",6),a(),f()),e&2){let s=t.$implicit,n=g().$implicit;l(2),p("innerHTML",n[s.prop],M)}}var he=e=>({"background-color":e});function Se(e,t){if(e&1&&(o(0,"tr",5),c(1,_e,3,1,"ng-container",3),a()),e&2){let s=t.$implicit,n=g();p("ngStyle",b(2,he,s.Status>200?"#F4D6D5":"#DEE9C9")),l(1),p("ngForOf",n.configs)}}var se=(()=>{let t=class t{constructor(){this.eventClose=new O}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=h({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,r){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ge,2,1,"th",3),a()(),o(5,"tbody"),c(6,Se,2,4,"tr",4),a()()()),i&2&&(l(4),p("ngForOf",r.configs),l(2),p("ngForOf",r.data))},dependencies:[w,P]});let e=t;return e})();function ye(e,t){if(e&1){let s=y();u(0),o(1,"button",23),_("click",function(){S(s);let i=g(),r=C(11);return v(i.onNewStepperState(r))}),d(2,"i",24),m(3," New "),a(),f()}}function Ce(e,t){if(e&1){let s=y();u(0),o(1,"button",23),_("click",function(){S(s),g();let i=C(11);return v(i.previous())}),m(2," Back "),a(),f()}}function be(e,t){if(e&1){let s=y();u(0),o(1,"button",25),_("click",function(){S(s);let i=g(),r=C(11);return v(i.onStepperNext(r))}),m(2," Next "),a(),f()}}function we(e,t){if(e&1){let s=y();u(0),o(1,"button",26),_("click",function(){S(s);let i=g(),r=C(11);return v(i.onSubmit(r))}),m(2,"Download"),a(),f()}if(e&2){let s=g();l(1),p("disabled",!s.urls)}}function xe(e,t){e&1&&m(0,"Instruction")}function Ie(e,t){e&1&&m(0,"Download")}function De(e,t){e&1&&m(0,"Finish")}function Ee(e,t){e&1&&d(0,"i",27)}function Te(e,t){e&1&&d(0,"i",28)}function Ne(e,t){e&1&&d(0,"i",29)}var me=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(n){this.stepperState=n.selectedStep.state}onSubmit(n){let i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(n)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(n=>(n.Name=n?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${n.ID}" target="_blank">
3
3
  ${n?.Name}
4
4
  </a>`:"-",n))}onNewStepperState(n){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",n.reset(),this.onStepperNext(n)}onStepperNext(n){n.selected.completed=!0,n.next()}};t.\u0275fac=function(i){return new(i||t)(E(I),E(q))},t.\u0275cmp=h({type:t,selectors:[["app-by-url"]],features:[B([{provide:ee,useValue:{displayDefaultIndicatorType:!1}}])],decls:41,vars:15,consts:[["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["labelPosition","bottom","linear","",1,"stepper-downloadByUrl",3,"selectedIndex","selectionChange"],["stepper",""],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],["state","DOWNLOAD",3,"editable","completed"],["name","url","cols","30","rows","25",1,"form-control",3,"placeholder","ngModel","ngModelChange"],["state","FINISH"],["status","error",3,"data","configs"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled","click"],[1,"fa-solid","fa-info"],[1,"fa-solid","fa-download"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(i,r){i&1&&(o(0,"mainpanel",0)(1,"actions"),c(2,ye,4,0,"ng-container",1)(3,Ce,3,0,"ng-container",1)(4,be,3,0,"ng-container",1)(5,we,3,1,"ng-container",1),a(),o(6,"content")(7,"div",2)(8,"div",3)(9,"div",4)(10,"mat-stepper",5,6),_("selectionChange",function(D){return r.onStepperChange(D)}),o(12,"mat-step",7),c(13,xe,1,0,"ng-template",8),o(14,"div",9)(15,"div",10)(16,"div",11)(17,"h4",12),m(18,"Note"),a()(),o(19,"div",13)(20,"ol",14)(21,"li"),m(22," Use this form to Download Products from Tokopedia using product URL "),a(),o(23,"li"),m(24," Copy Product URL from "),o(25,"a",15),m(26,"https://seller.tokopedia.com/ "),a(),m(27," and paste in this form "),a(),o(28,"li"),m(29," Use New Line when you want to input several product URLs "),a()()()()()(),o(30,"mat-step",16),c(31,Ie,1,0,"ng-template",8),o(32,"div",9)(33,"textarea",17),_("ngModelChange",function(D){return r.urls=D}),a()()(),o(34,"mat-step",18),c(35,De,1,0,"ng-template",8),o(36,"div",9),d(37,"app-response-api-list",19),a()(),c(38,Ee,1,0,"ng-template",20)(39,Te,1,0,"ng-template",21)(40,Ne,1,0,"ng-template",22),a()()()()()()),i&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",r.stepperState=="FINISH"),l(1),p("ngIf",r.stepperState=="DOWNLOAD"),l(1),p("ngIf",r.stepperState=="GUIDE"),l(1),p("ngIf",r.stepperState=="DOWNLOAD"),l(5),p("selectedIndex",1),l(2),p("editable",r.stepperState!="FINISH")("completed",!0),l(18),p("editable",r.stepperState!="FINISH")("completed",!1),l(3),p("placeholder",r.urlPlaceholder)("ngModel",r.urls),l(4),p("data",r.downloadResponses)("configs",r.configs))},dependencies:[R,W,z,G,Q,oe,ne,re,ie,se],styles:[`.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px}
@@ -1 +1 @@
1
- import{a as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-S65ISV4X.js";import{c as z,d as j,e as q,f as G,g as H,h as J,i as K,j as Q,k as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-TBY7FO23.js";import{a as L,c as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-Z2ABDS6L.js";import{c as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-BELWZRNY.js";import{b as P,g as V,h as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-2OB3TW2H.js";import{Q as R,R as F,S as I,T as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-LKSBRXCX.js";import{u as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-PQGHN52M.js";import{$a as v,Ea as o,Ia as h,Na as r,Qa as M,Ta as k,Ya as p,Yb as S,Za as m,_a as w,ab as Y,cb as _,da as D,dc as b,gb as c,ia as u,ib as y,ja as f,nb as g,ob as C,sb as E,tb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-FWCMOK42.js";function Z(l,a){if(l&1){let X=_();v(0),p(1,"mat-date-range-picker-actions")(2,"button",8),C(3,"Cancel"),m(),p(4,"button",9),c("click",function(){u(X);let e=y();return f(e.onSelectDate())}),C(5,"Search"),m()(),Y()}}var $={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},he=(()=>{let a=class a{constructor(){this.disabled=!1,this.widthClass="w-100",this.showButtonConfirm=!1,this.dateChange=new h}fromDateChange(t){let e=t?.toDate();this.from=e}toDateChange(t){if(t){let e=t.toDate();this.to=e,this.showButtonConfirm||this.emitDateChange()}}onOpenDatepicker(){console.log("open");let t=document.getElementById("dropdown-filter");if(t){var e=new bootstrap.Dropdown(t);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){console.log("close");let t=document.getElementById("dropdown-filter");if(t){var e=new bootstrap.Dropdown(t);e&&(e._config.autoClose="outside")}}emitDateChange(){this.dateChange.emit({from:this.from,to:this.to})}onSelectDate(){this.emitDateChange()}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["app-datepicker-range"]],inputs:{placeholder:"placeholder",displayToggle:"displayToggle",date:"date",disabled:"disabled",minDate:"minDate",widthClass:"widthClass",showButtonConfirm:"showButtonConfirm",from:"from",to:"to"},outputs:{dateChange:"dateChange"},standalone:!0,features:[E([{provide:F,useClass:W,deps:[R]},{provide:I,useValue:$}]),T],decls:8,vars:8,consts:[["appearance","outline",1,"date-range"],["id","dates",3,"min","rangePicker"],["matStartDate","","placeholder","Start date",3,"value","dateChange","click"],["matEndDate","","placeholder","End date",3,"value","dateChange","click"],["matPrefix","",3,"for"],[3,"opened","closed"],["picker",""],[4,"ngIf"],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(e,n){if(e&1){let d=_();p(0,"mat-form-field",0)(1,"mat-date-range-input",1)(2,"input",2),c("dateChange",function(i){return n.fromDateChange(i.value)})("click",function(){u(d);let i=g(6);return f(i.open())}),m(),p(3,"input",3),c("dateChange",function(i){return n.toDateChange(i.value)})("click",function(){u(d);let i=g(6);return f(i.open())}),m()(),w(4,"mat-datepicker-toggle",4),p(5,"mat-date-range-picker",5,6),c("opened",function(){return n.onOpenDatepicker()})("closed",function(){return n.onCloseDatepicker()}),k(7,Z,6,0,"ng-container",7),m()()}if(e&2){let d=g(6);M(n.widthClass),o(1),r("min",n.minDate)("rangePicker",d),o(1),r("value",n.from),o(1),r("value",n.to),o(1),r("for",d),o(3),r("ngIf",n.showButtonConfirm)}},dependencies:[b,S,B,U,z,G,j,q,H,Q,K,J,x,V,P,N,A,O,L],styles:["mat-form-field.date-range.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{padding-top:12px!important;padding-bottom:12px!important;min-height:45px!important;font-size:14px!important}"]});let l=a;return l})();export{he as a};
1
+ import{a as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-Q4Y764AE.js";import{c as z,d as j,e as q,f as G,g as H,h as J,i as K,j as Q,k as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-QJKKB3RG.js";import{a as L,c as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-RHM4GQMX.js";import{c as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-R3VPTXDH.js";import{b as P,g as V,h as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-6FFJWFMY.js";import{Q as R,R as F,S as I,T as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-32YQ5ZBK.js";import{u as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-UUMW24BF.js";import{$a as v,Ea as o,Ia as h,Na as r,Qa as M,Ta as k,Ya as p,Yb as S,Za as m,_a as w,ab as Y,cb as _,da as D,dc as b,gb as c,ia as u,ib as y,ja as f,nb as g,ob as C,sb as E,tb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";function Z(l,a){if(l&1){let X=_();v(0),p(1,"mat-date-range-picker-actions")(2,"button",8),C(3,"Cancel"),m(),p(4,"button",9),c("click",function(){u(X);let e=y();return f(e.onSelectDate())}),C(5,"Search"),m()(),Y()}}var $={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},he=(()=>{let a=class a{constructor(){this.disabled=!1,this.widthClass="w-100",this.showButtonConfirm=!1,this.dateChange=new h}fromDateChange(t){let e=t?.toDate();this.from=e}toDateChange(t){if(t){let e=t.toDate();this.to=e,this.showButtonConfirm||this.emitDateChange()}}onOpenDatepicker(){console.log("open");let t=document.getElementById("dropdown-filter");if(t){var e=new bootstrap.Dropdown(t);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){console.log("close");let t=document.getElementById("dropdown-filter");if(t){var e=new bootstrap.Dropdown(t);e&&(e._config.autoClose="outside")}}emitDateChange(){this.dateChange.emit({from:this.from,to:this.to})}onSelectDate(){this.emitDateChange()}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["app-datepicker-range"]],inputs:{placeholder:"placeholder",displayToggle:"displayToggle",date:"date",disabled:"disabled",minDate:"minDate",widthClass:"widthClass",showButtonConfirm:"showButtonConfirm",from:"from",to:"to"},outputs:{dateChange:"dateChange"},standalone:!0,features:[E([{provide:F,useClass:W,deps:[R]},{provide:I,useValue:$}]),T],decls:8,vars:8,consts:[["appearance","outline",1,"date-range"],["id","dates",3,"min","rangePicker"],["matStartDate","","placeholder","Start date",3,"value","dateChange","click"],["matEndDate","","placeholder","End date",3,"value","dateChange","click"],["matPrefix","",3,"for"],[3,"opened","closed"],["picker",""],[4,"ngIf"],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(e,n){if(e&1){let d=_();p(0,"mat-form-field",0)(1,"mat-date-range-input",1)(2,"input",2),c("dateChange",function(i){return n.fromDateChange(i.value)})("click",function(){u(d);let i=g(6);return f(i.open())}),m(),p(3,"input",3),c("dateChange",function(i){return n.toDateChange(i.value)})("click",function(){u(d);let i=g(6);return f(i.open())}),m()(),w(4,"mat-datepicker-toggle",4),p(5,"mat-date-range-picker",5,6),c("opened",function(){return n.onOpenDatepicker()})("closed",function(){return n.onCloseDatepicker()}),k(7,Z,6,0,"ng-container",7),m()()}if(e&2){let d=g(6);M(n.widthClass),o(1),r("min",n.minDate)("rangePicker",d),o(1),r("value",n.from),o(1),r("value",n.to),o(1),r("for",d),o(3),r("ngIf",n.showButtonConfirm)}},dependencies:[b,S,B,U,z,G,j,q,H,Q,K,J,x,V,P,N,A,O,L],styles:["mat-form-field.date-range.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{padding-top:12px!important;padding-bottom:12px!important;min-height:45px!important;font-size:14px!important}"]});let l=a;return l})();export{he as a};
@@ -1 +1 @@
1
- import{d as D,e as H,f as B,g as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-HWOBJ4Z3.js";import{Ea as a,Ia as b,Na as r,Oa as O,Ra as v,Ta as _,Vb as V,Ya as l,Yb as F,Za as c,_a as M,cb as u,da as w,dc as j,gb as f,ia as p,ib as s,ja as g,jb as P,kb as h,ob as C,pb as T,qb as I,tb as S,vb as E,wb as y,xa as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-FWCMOK42.js";var m=function(t){return t.Success="Success",t.Info="Info",t.Warning="Warning",t.Error="Error",t}(m||{});var x=class{constructor(){this.title="New Modal",this.titleExtra="",this.okText="OK",this.cancelText="CANCEL",this.hideFooter=!1,this.hideCancel=!1,this.hideOk=!1,this.hideClose=!1,this.eMoney=!1,this.headerType=m.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.showMoreButton=!1,this.noPadding=!1}};function L(t,n){if(t&1){let e=u();l(0,"div",9),f("click",function(){p(e);let i=s();return g(i.onBack.emit())}),l(1,"a",10),M(2,"i",11),c()()}}function W(t,n){if(t&1){let e=u();l(0,"div",12)(1,"a",13),f("click",function(){p(e);let i=s();return g(i.onCancel.emit())}),M(2,"i",14),c()()}}function A(t,n){t&1&&h(0,2,["*ngIf","more"])}function z(t,n){if(t&1){let e=u();l(0,"a",19),f("click",function(){p(e);let i=s(2);return g(i.more=!i.more)}),C(1,"More"),c()}}function q(t,n){if(t&1){let e=u();l(0,"button",20),f("click",function(){p(e);let i=s(2);return g(i.onCancel.emit())}),C(1),c()}if(t&2){let e=s(2);a(1),I(" ",e.config.cancelText?e.config.cancelText:"CANCEL","")}}function G(t,n){if(t&1){let e=u();l(0,"button",21),f("click",function(){p(e);let i=s(2);return g(i.onOk.emit())})("keyup.F2",function(){p(e);let i=s(2);return g(i.onOk.emit())}),c()}if(t&2){let e=s(2);r("disabled",!e.config.validated||!e.dynamicValidated)("innerHTML",e.config.okText?e.config.okText:"OK",k)}}function J(t,n){if(t&1&&(l(0,"mat-dialog-actions",15),_(1,z,2,0,"a",16),h(2,3),_(3,q,2,1,"button",17)(4,G,1,2,"button",18),c()),t&2){let e=s();a(1),r("ngIf",e.config.showMoreButton),a(2),r("ngIf",!e.config.hideCancel),a(1),r("ngIf",!e.config.hideOk)}}var Q=[[["","header",""]],[["","content",""]],[["","more-content",""]],[["","footer",""]]],R=(t,n)=>({bodyScrollable:t,hideScrollbar:n}),U=t=>({"mx-auto":t}),X=(t,n)=>({"show-footer":t,"p-0":n}),Y=["[header]","[content]","[more-content]","[footer]"],gt=(()=>{let n=class n{constructor(){this.dynamicValidated=!0,this.onOk=new b,this.onCancel=new b,this.onClose=new b,this.onBack=new b,this.term="",this.more=!1}ngOnInit(){switch(this.config==null&&(this.config=new x),this.config.headerType){case m.Success:this.background="bg-success";break;case m.Warning:this.background="bg-warning";break;case m.Info:this.background="bg-warning";break;case m.Error:this.background="bg-danger";break;default:this.background="";break}}onKeyup(d){this.config.disableKeyup||(d.code=="F2"&&this.onOk.emit("F2"),(d.code=="Enter"||d.code=="NumpadEnter")&&this.onOk.emit("Enter"))}};n.\u0275fac=function(i){return new(i||n)},n.\u0275cmp=w({type:n,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},standalone:!0,features:[S],ngContentSelectors:Y,decls:12,vars:21,consts:[[1,"modal-material","d-flex","align-items-start","flex-column","position-relative","maxHeight",3,"ngClass","keyup"],["mat-dialog-title",""],["class","back-button position-absolute pointer d-print-none",3,"click",4,"ngIf"],[1,"d-flex","flex-row","d-print-none",3,"ngClass"],[1,"fw-normal","text-white"],["class","ps-3",4,"ngIf"],[1,"modal-body","w-100",3,"ngClass"],[4,"ngIf"],["class","w-100 mt-10 py-7 border-top d-flex justify-content-end d-print-none",4,"ngIf"],[1,"back-button","position-absolute","pointer","d-print-none",3,"click"],[1,"btn","back-button"],[1,"fa-solid","fa-arrow-left"],[1,"ps-3"],[1,"btn-light-blue","btn-sm","pointer","close",3,"click"],[1,"fas","fa-times","fa-md","text-primary"],[1,"w-100","mt-10","py-7","border-top","d-flex","justify-content-end","d-print-none"],["class","more clearfix",3,"click",4,"ngIf"],["class","btn btn-light-blue text-primary btn-lg fw-bold mx-3 py-8",3,"click",4,"ngIf"],["style","width: 70px;","class","btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3 py-8","data-cy","ConfirmOk",3,"disabled","innerHTML","click","keyup.F2",4,"ngIf"],[1,"more","clearfix",3,"click"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click"],["data-cy","ConfirmOk",1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",2,"width","70px",3,"disabled","innerHTML","click","keyup.F2"]],template:function(i,o){i&1&&(P(Q),l(0,"div",0),f("keyup",function(N){return o.onKeyup(N)}),l(1,"div",1),_(2,L,3,0,"div",2),l(3,"div",3)(4,"h3",4),C(5),c(),h(6),c(),_(7,W,3,0,"div",5),c(),l(8,"mat-dialog-content",6),h(9,1),_(10,A,1,0,"ng-content",7),c(),_(11,J,5,3,"mat-dialog-actions",8),c()),i&2&&(O("width",o.config.customWidth),r("ngClass",y(13,R,o.config.bodyScrollable,o.config.hideScrollbar)),a(1),v("d-flex w-100 justify-content-between modal-header position-relative ",o.background,""),a(1),r("ngIf",o.config.eMoney),a(1),r("ngClass",E(16,U,o.config.eMoney)),a(2),T(o.config.title),a(2),r("ngIf",!o.config.hideClose),a(1),r("ngClass",y(18,X,!o.config.hideFooter,o.config.noPadding)),a(2),r("ngIf",o.more),a(1),r("ngIf",!o.config.hideFooter))},dependencies:[j,V,F,K,D,B,H],styles:[".mat-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important} .mat-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{ .mat-dialog-container{box-shadow:unset;width:100vw}}@media print{ .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body[_ngcontent-%COMP%]{width:100vw!important}}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:100%!important}.maxHeight.bodyScrollable[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px!important;overflow-y:auto}body.modal-body[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}mat-dialog-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:15px!important;margin-right:12px}mat-dialog-actions[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button[_ngcontent-%COMP%]{top:5px;left:0}.close[_ngcontent-%COMP%]{padding:.4rem .5rem}.no-padding[_ngcontent-%COMP%]{padding:0}.modal-material[_ngcontent-%COMP%]{width:40vw}@media (max-width: 992px){.modal-material[_ngcontent-%COMP%]{width:50vw!important}}.modal-header[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:15px}.modal-dialog[_ngcontent-%COMP%]{max-width:none}.modal-content[_ngcontent-%COMP%]{width:auto;margin:auto;max-width:850px}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:400px;overflow:auto}.modal-body[_ngcontent-%COMP%]{padding:1rem}.modal-body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block}.modal-body[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin:0;position:absolute;bottom:-20px}.modal-body[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] input[type=password][_ngcontent-%COMP%]{border:1px solid #c8d3df;padding:5px 7px}.modal-body[_ngcontent-%COMP%] table[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:330px;height:90px}"]});let t=n;return t})();export{m as a,x as b,gt as c};
1
+ import{d as D,e as H,f as B,g as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-QV22VQ5Q.js";import{Ea as a,Ia as b,Na as r,Oa as O,Ra as v,Ta as _,Vb as V,Ya as l,Yb as F,Za as c,_a as M,cb as u,da as w,dc as j,gb as f,ia as p,ib as s,ja as g,jb as P,kb as h,ob as C,pb as T,qb as I,tb as S,vb as E,wb as y,xa as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";var m=function(t){return t.Success="Success",t.Info="Info",t.Warning="Warning",t.Error="Error",t}(m||{});var x=class{constructor(){this.title="New Modal",this.titleExtra="",this.okText="OK",this.cancelText="CANCEL",this.hideFooter=!1,this.hideCancel=!1,this.hideOk=!1,this.hideClose=!1,this.eMoney=!1,this.headerType=m.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.showMoreButton=!1,this.noPadding=!1}};function L(t,n){if(t&1){let e=u();l(0,"div",9),f("click",function(){p(e);let i=s();return g(i.onBack.emit())}),l(1,"a",10),M(2,"i",11),c()()}}function W(t,n){if(t&1){let e=u();l(0,"div",12)(1,"a",13),f("click",function(){p(e);let i=s();return g(i.onCancel.emit())}),M(2,"i",14),c()()}}function A(t,n){t&1&&h(0,2,["*ngIf","more"])}function z(t,n){if(t&1){let e=u();l(0,"a",19),f("click",function(){p(e);let i=s(2);return g(i.more=!i.more)}),C(1,"More"),c()}}function q(t,n){if(t&1){let e=u();l(0,"button",20),f("click",function(){p(e);let i=s(2);return g(i.onCancel.emit())}),C(1),c()}if(t&2){let e=s(2);a(1),I(" ",e.config.cancelText?e.config.cancelText:"CANCEL","")}}function G(t,n){if(t&1){let e=u();l(0,"button",21),f("click",function(){p(e);let i=s(2);return g(i.onOk.emit())})("keyup.F2",function(){p(e);let i=s(2);return g(i.onOk.emit())}),c()}if(t&2){let e=s(2);r("disabled",!e.config.validated||!e.dynamicValidated)("innerHTML",e.config.okText?e.config.okText:"OK",k)}}function J(t,n){if(t&1&&(l(0,"mat-dialog-actions",15),_(1,z,2,0,"a",16),h(2,3),_(3,q,2,1,"button",17)(4,G,1,2,"button",18),c()),t&2){let e=s();a(1),r("ngIf",e.config.showMoreButton),a(2),r("ngIf",!e.config.hideCancel),a(1),r("ngIf",!e.config.hideOk)}}var Q=[[["","header",""]],[["","content",""]],[["","more-content",""]],[["","footer",""]]],R=(t,n)=>({bodyScrollable:t,hideScrollbar:n}),U=t=>({"mx-auto":t}),X=(t,n)=>({"show-footer":t,"p-0":n}),Y=["[header]","[content]","[more-content]","[footer]"],gt=(()=>{let n=class n{constructor(){this.dynamicValidated=!0,this.onOk=new b,this.onCancel=new b,this.onClose=new b,this.onBack=new b,this.term="",this.more=!1}ngOnInit(){switch(this.config==null&&(this.config=new x),this.config.headerType){case m.Success:this.background="bg-success";break;case m.Warning:this.background="bg-warning";break;case m.Info:this.background="bg-warning";break;case m.Error:this.background="bg-danger";break;default:this.background="";break}}onKeyup(d){this.config.disableKeyup||(d.code=="F2"&&this.onOk.emit("F2"),(d.code=="Enter"||d.code=="NumpadEnter")&&this.onOk.emit("Enter"))}};n.\u0275fac=function(i){return new(i||n)},n.\u0275cmp=w({type:n,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},standalone:!0,features:[S],ngContentSelectors:Y,decls:12,vars:21,consts:[[1,"modal-material","d-flex","align-items-start","flex-column","position-relative","maxHeight",3,"ngClass","keyup"],["mat-dialog-title",""],["class","back-button position-absolute pointer d-print-none",3,"click",4,"ngIf"],[1,"d-flex","flex-row","d-print-none",3,"ngClass"],[1,"fw-normal","text-white"],["class","ps-3",4,"ngIf"],[1,"modal-body","w-100",3,"ngClass"],[4,"ngIf"],["class","w-100 mt-10 py-7 border-top d-flex justify-content-end d-print-none",4,"ngIf"],[1,"back-button","position-absolute","pointer","d-print-none",3,"click"],[1,"btn","back-button"],[1,"fa-solid","fa-arrow-left"],[1,"ps-3"],[1,"btn-light-blue","btn-sm","pointer","close",3,"click"],[1,"fas","fa-times","fa-md","text-primary"],[1,"w-100","mt-10","py-7","border-top","d-flex","justify-content-end","d-print-none"],["class","more clearfix",3,"click",4,"ngIf"],["class","btn btn-light-blue text-primary btn-lg fw-bold mx-3 py-8",3,"click",4,"ngIf"],["style","width: 70px;","class","btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3 py-8","data-cy","ConfirmOk",3,"disabled","innerHTML","click","keyup.F2",4,"ngIf"],[1,"more","clearfix",3,"click"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click"],["data-cy","ConfirmOk",1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",2,"width","70px",3,"disabled","innerHTML","click","keyup.F2"]],template:function(i,o){i&1&&(P(Q),l(0,"div",0),f("keyup",function(N){return o.onKeyup(N)}),l(1,"div",1),_(2,L,3,0,"div",2),l(3,"div",3)(4,"h3",4),C(5),c(),h(6),c(),_(7,W,3,0,"div",5),c(),l(8,"mat-dialog-content",6),h(9,1),_(10,A,1,0,"ng-content",7),c(),_(11,J,5,3,"mat-dialog-actions",8),c()),i&2&&(O("width",o.config.customWidth),r("ngClass",y(13,R,o.config.bodyScrollable,o.config.hideScrollbar)),a(1),v("d-flex w-100 justify-content-between modal-header position-relative ",o.background,""),a(1),r("ngIf",o.config.eMoney),a(1),r("ngClass",E(16,U,o.config.eMoney)),a(2),T(o.config.title),a(2),r("ngIf",!o.config.hideClose),a(1),r("ngClass",y(18,X,!o.config.hideFooter,o.config.noPadding)),a(2),r("ngIf",o.more),a(1),r("ngIf",!o.config.hideFooter))},dependencies:[j,V,F,K,D,B,H],styles:[".mat-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important} .mat-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{ .mat-dialog-container{box-shadow:unset;width:100vw}}@media print{ .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body[_ngcontent-%COMP%]{width:100vw!important}}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:100%!important}.maxHeight.bodyScrollable[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px!important;overflow-y:auto}body.modal-body[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}mat-dialog-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:15px!important;margin-right:12px}mat-dialog-actions[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button[_ngcontent-%COMP%]{top:5px;left:0}.close[_ngcontent-%COMP%]{padding:.4rem .5rem}.no-padding[_ngcontent-%COMP%]{padding:0}.modal-material[_ngcontent-%COMP%]{width:40vw}@media (max-width: 992px){.modal-material[_ngcontent-%COMP%]{width:50vw!important}}.modal-header[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:15px}.modal-dialog[_ngcontent-%COMP%]{max-width:none}.modal-content[_ngcontent-%COMP%]{width:auto;margin:auto;max-width:850px}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:400px;overflow:auto}.modal-body[_ngcontent-%COMP%]{padding:1rem}.modal-body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block}.modal-body[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin:0;position:absolute;bottom:-20px}.modal-body[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] input[type=password][_ngcontent-%COMP%]{border:1px solid #c8d3df;padding:5px 7px}.modal-body[_ngcontent-%COMP%] table[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:330px;height:90px}"]});let t=n;return t})();export{m as a,x as b,gt as c};
@@ -1 +1 @@
1
- import{$ as K,A as b,E as F,Eb as X,Gc as Z,Ha as q,I as L,Ia as V,K as G,M as y,Q as M,S as j,Sa as Q,W as C,_ as f,aa as E,ba as c,ca as p,d,ea as N,fa as J,ha as Y,m as g,n as h,q as S,s as m,t as I,w as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-FWCMOK42.js";import{a as l,b as v}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.0/Marketplace/chunk-N76YHCQ6.js";var A={REMOVE:"remove",SHOW:"show"},ee=(()=>{let t=class t{constructor(){this.strategiesSource=new d({}),this.strategies$=this.strategiesSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),B=new E("USE_CONFIGURATION_STORE"),$=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.configurationStore=i,this.strategiesSource=this.isolate?new d({}):this.configurationStore.strategiesSource,this.strategies$=this.strategiesSource.asObservable(),this.onAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onAuthorisedDefaultStrategy,this.onUnAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onUnAuthorisedDefaultStrategy}setDefaultOnAuthorizedStrategy(e){this.isolate?this.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onAuthorisedDefaultStrategy=this.configurationStore.onAuthorisedDefaultStrategy)}setDefaultOnUnauthorizedStrategy(e){this.isolate?this.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onUnAuthorisedDefaultStrategy=this.configurationStore.onUnAuthorisedDefaultStrategy)}addPermissionStrategy(e,i){this.strategiesSource.value[e]=i}getStrategy(e){return this.strategiesSource.value[e]}getAllStrategies(){return this.strategiesSource.value}getDefinedStrategy(e){if(this.strategiesSource.value[e]||this.isPredefinedStrategy(e))return e;throw new Error(`No ' ${e} ' strategy is found please define one`)}isPredefinedStrategy(e){return e===A.SHOW||e===A.REMOVE}};t.\u0275fac=function(i){return new(i||t)(c(B),c(ee))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();function u(r){return typeof r=="function"}function k(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;{let t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}}function ie(r){return!!r&&typeof r=="string"}function T(r){return typeof r=="boolean"}function te(r){return Object.prototype.toString.call(r)==="[object Promise]"}function O(r){return Array.isArray(r)?r.length>0:!!r}function R(r){return ie(r)?[r]:r}var se=(()=>{let t=class t{constructor(){this.permissionsSource=new d({}),this.permissions$=this.permissionsSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),W=new E("USE_PERMISSIONS_STORE"),x=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.permissionsStore=i,this.permissionsSource=this.isolate?new d({}):this.permissionsStore.permissionsSource,this.permissions$=this.permissionsSource.asObservable()}flushPermissions(){this.permissionsSource.next({})}hasPermission(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=R(e),this.hasArrayPermission(e))}loadPermissions(e,i){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),{});this.permissionsSource.next(s)}addPermission(e,i){if(Array.isArray(e)){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),this.permissionsSource.value);this.permissionsSource.next(s)}else{let s=this.reducePermission(this.permissionsSource.value,e,i);this.permissionsSource.next(s)}}removePermission(e){let i=l({},this.permissionsSource.value);delete i[e],this.permissionsSource.next(i)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,i,s){return s&&u(s)?v(l({},e),{[i]:{name:i,validationFunction:s}}):v(l({},e),{[i]:{name:i}})}hasArrayPermission(e){let i=e.map(s=>{if(this.hasPermissionValidationFunction(s)){let o=this.permissionsSource.value[s].validationFunction,n=l({},this.permissionsSource.value);return h(null).pipe(S(()=>o(s,n)),j(a=>T(a)?h(a):a),F(()=>h(!1)))}return h(!!this.permissionsSource.value[s])});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&u(this.permissionsSource.value[e].validationFunction)}};t.\u0275fac=function(i){return new(i||t)(c(W),c(se))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),U=class{constructor(){this.rolesSource=new d({}),this.roles$=this.rolesSource.asObservable()}},H=new E("USE_ROLES_STORE"),D=(()=>{let t=class t{constructor(e=!1,i,s){this.isolate=e,this.rolesStore=i,this.permissionsService=s,this.rolesSource=this.isolate?new d({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,i){let s=v(l({},this.rolesSource.value),{[e]:{name:e,validationFunction:i}});this.rolesSource.next(s)}addRoleWithPermissions(e,i){this.permissionsService.addPermission(i),this.addRole(e,i)}addRoles(e){Object.keys(e).forEach((i,s)=>{this.addRole(i,e[i])})}addRolesWithPermissions(e){Object.keys(e).forEach((i,s)=>{this.addRoleWithPermissions(i,e[i])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let i=l({},this.rolesSource.value);delete i[e],this.rolesSource.next(i)}getRoles(){return this.rolesSource.value}getRole(e){return this.rolesSource.value[e]}hasOnlyRoles(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=R(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([s,o])=>s||o))}hasRoleKey(e){let i=e.map(s=>{if(!!this.rolesSource.value[s]&&!!this.rolesSource.value[s].validationFunction&&u(this.rolesSource.value[s].validationFunction)&&!te(this.rolesSource.value[s].validationFunction)){let n=this.rolesSource.value[s].validationFunction,a=l({},this.rolesSource.value);return h(null).pipe(S(()=>n(s,a)),j(P=>T(P)?h(P):P),F(()=>h(!1)))}return h(!1)});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasRolePermission(e,i){return g(i).pipe(m(s=>e[s]&&Array.isArray(e[s].validationFunction)?g(e[s].validationFunction).pipe(m(o=>this.permissionsService.hasPermission(o)),G(o=>o===!0)):h(!1)),y(s=>s===!0,!1)).toPromise()}};t.\u0275fac=function(i){return new(i||t)(c(H),c(U),c(x))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),pe=(()=>{let t=class t{constructor(){this.permissionsAuthorized=new V,this.permissionsUnauthorized=new V,this.firstMergeUnusedRun=1,this.permissionsService=p(x),this.configurationService=p($),this.rolesService=p(D),this.viewContainer=p(Q),this.changeDetector=p(q),this.templateRef=p(X)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let i=e.ngxPermissionsOnly,s=e.ngxPermissionsExcept;if(i||s){if(i&&i.firstChange||s&&s.firstChange)return;b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun),L(1)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,i])=>{if(e||i){this.handleUnauthorisedPermission(this.ngxPermissionsExceptElse||this.ngxPermissionsElse);return}if(this.ngxPermissionsOnly)throw!1;this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)}).catch(()=>{this.ngxPermissionsOnly?this.validateOnlyPermissions():this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)})}validateOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsOnly),this.rolesService.hasOnlyRoles(this.ngxPermissionsOnly)]).then(([e,i])=>{e||i?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(T(this.currentAuthorizedState)&&!this.currentAuthorizedState)){if(this.currentAuthorizedState=!1,this.permissionsUnauthorized.emit(),this.getUnAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getUnAuthorizedStrategyInput());return}this.configurationService.onUnAuthorisedDefaultStrategy&&!this.elseBlockDefined()?this.applyStrategy(this.configurationService.onUnAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}handleAuthorisedPermission(e){if(!(T(this.currentAuthorizedState)&&this.currentAuthorizedState)){if(this.currentAuthorizedState=!0,this.permissionsAuthorized.emit(),this.getAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getAuthorizedStrategyInput());return}this.configurationService.onAuthorisedDefaultStrategy&&!this.thenBlockDefined()?this.applyStrategy(this.configurationService.onAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}applyStrategyAccordingToStrategyType(e){if(ie(e)){this.applyStrategy(e);return}if(u(e)){this.showTemplateBlockInView(this.templateRef),e(this.templateRef);return}}showTemplateBlockInView(e){this.viewContainer.clear(),e&&(this.viewContainer.createEmbeddedView(e),this.changeDetector.markForCheck())}getAuthorisedTemplates(){return this.ngxPermissionsOnlyThen||this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef}elseBlockDefined(){return!!this.ngxPermissionsExceptElse||!!this.ngxPermissionsElse}thenBlockDefined(){return!!this.ngxPermissionsExceptThen||!!this.ngxPermissionsThen}getAuthorizedStrategyInput(){return this.ngxPermissionsOnlyAuthorisedStrategy||this.ngxPermissionsExceptAuthorisedStrategy||this.ngxPermissionsAuthorisedStrategy}getUnAuthorizedStrategyInput(){return this.ngxPermissionsOnlyUnauthorisedStrategy||this.ngxPermissionsExceptUnauthorisedStrategy||this.ngxPermissionsUnauthorisedStrategy}applyStrategy(e){if(e===A.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===A.REMOVE){this.viewContainer.clear();return}let i=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),i(this.templateRef)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275dir=J({type:t,selectors:[["","ngxPermissionsOnly",""],["","ngxPermissionsExcept",""]],inputs:{ngxPermissionsOnly:"ngxPermissionsOnly",ngxPermissionsOnlyThen:"ngxPermissionsOnlyThen",ngxPermissionsOnlyElse:"ngxPermissionsOnlyElse",ngxPermissionsExcept:"ngxPermissionsExcept",ngxPermissionsExceptElse:"ngxPermissionsExceptElse",ngxPermissionsExceptThen:"ngxPermissionsExceptThen",ngxPermissionsThen:"ngxPermissionsThen",ngxPermissionsElse:"ngxPermissionsElse",ngxPermissionsOnlyAuthorisedStrategy:"ngxPermissionsOnlyAuthorisedStrategy",ngxPermissionsOnlyUnauthorisedStrategy:"ngxPermissionsOnlyUnauthorisedStrategy",ngxPermissionsExceptUnauthorisedStrategy:"ngxPermissionsExceptUnauthorisedStrategy",ngxPermissionsExceptAuthorisedStrategy:"ngxPermissionsExceptAuthorisedStrategy",ngxPermissionsUnauthorisedStrategy:"ngxPermissionsUnauthorisedStrategy",ngxPermissionsAuthorisedStrategy:"ngxPermissionsAuthorisedStrategy"},outputs:{permissionsAuthorized:"permissionsAuthorized",permissionsUnauthorized:"permissionsUnauthorized"},features:[Y]});let r=t;return r})(),re="default";var _=(()=>{let t=class t{constructor(e,i,s){this.permissionsService=e,this.rolesService=i,this.router=s}canActivate(e,i){return this.hasPermissions(e,i)}canActivateChild(e,i){return this.hasPermissions(e,i)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,i){let s=e&&e.data?e.data.permissions:{},o=this.transformPermission(s,e,i);return this.isParameterAvailable(o.except)?this.passingExceptPermissionsValidation(o,e,i):this.isParameterAvailable(o.only)?this.passingOnlyPermissionsValidation(o,e,i):!0}transformPermission(e,i,s){let o=u(e.only)?e.only(i,s):R(e.only),n=u(e.except)?e.except(i,s):R(e.except),a=e.redirectTo;return{only:o,except:n,redirectTo:a}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,i,s){if(e.redirectTo&&(u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let o="";return g(e.except).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)||(o=n)}))),y(n=>n.some(a=>a===!0),!1),m(n=>o?(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):!n&&e.only?this.onlyRedirectCheck(e,i,s):h(!n))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([o,n])=>o||n?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,i,s),!1):e.only?this.checkOnlyPermissions(e,i,s):!0)}redirectToAnotherRoute(e,i,s,o){let n=u(e)?e(o,i,s):e;if(this.isRedirectionWithParameters(n)){n.navigationCommands=this.transformNavigationCommands(n.navigationCommands,i,s),n.navigationExtras=this.transformNavigationExtras(n.navigationExtras,i,s),this.router.navigate(n.navigationCommands,n.navigationExtras);return}Array.isArray(n)?this.router.navigate(n):this.router.navigate([n])}isRedirectionWithParameters(e){return k(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,i,s){return u(e)?e(i,s):e}transformNavigationExtras(e,i,s){return u(e)?e(i,s):e}onlyRedirectCheck(e,i,s){let o="";return g(e.only).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)&&(o=n)}))),y(n=>u(e.redirectTo)?n.some(a=>a===!0):n.every(a=>a===!1),!1),m(n=>u(e.redirectTo)?n?h(!0):(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):(o&&this.handleRedirectOfFailedPermission(e,o,i,s),h(!n)))).toPromise()}handleRedirectOfFailedPermission(e,i,s,o){this.isFailedPermissionPropertyOfRedirectTo(e,i)?this.redirectToAnotherRoute(e.redirectTo[i],s,o,i):u(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,s,o,i):this.redirectToAnotherRoute(e.redirectTo[re],s,o,i)}isFailedPermissionPropertyOfRedirectTo(e,i){return!!e.redirectTo&&e.redirectTo[i]}checkOnlyPermissions(e,i,s){let o=l({},e);return Promise.all([this.permissionsService.hasPermission(o.only),this.rolesService.hasOnlyRoles(o.only)]).then(([n,a])=>n||a?!0:(o.redirectTo&&this.redirectToAnotherRoute(o.redirectTo,i,s),!1))}passingOnlyPermissionsValidation(e,i,s){return u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,i,s):this.checkOnlyPermissions(e,i,s)}};t.\u0275fac=function(i){return new(i||t)(c(x),c(D),c(Z))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();var ye=(()=>{let t=class t{static forRoot(e={}){return{ngModule:t,providers:[se,U,ee,x,_,D,$,{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:t,providers:[{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate},$,x,D,_]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=N({type:t}),t.\u0275inj=K({});let r=t;return r})();export{x as a,pe as b,ye as c};
1
+ import{$ as K,A as b,E as F,Eb as X,Gc as Z,Ha as q,I as L,Ia as V,K as G,M as y,Q as M,S as j,Sa as Q,W as C,_ as f,aa as E,ba as c,ca as p,d,ea as N,fa as J,ha as Y,m as g,n as h,q as S,s as m,t as I,w as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-LWR5YJ24.js";import{a as l,b as v}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.4.1/Marketplace/chunk-J3NU4TSW.js";var A={REMOVE:"remove",SHOW:"show"},ee=(()=>{let t=class t{constructor(){this.strategiesSource=new d({}),this.strategies$=this.strategiesSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),B=new E("USE_CONFIGURATION_STORE"),$=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.configurationStore=i,this.strategiesSource=this.isolate?new d({}):this.configurationStore.strategiesSource,this.strategies$=this.strategiesSource.asObservable(),this.onAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onAuthorisedDefaultStrategy,this.onUnAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onUnAuthorisedDefaultStrategy}setDefaultOnAuthorizedStrategy(e){this.isolate?this.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onAuthorisedDefaultStrategy=this.configurationStore.onAuthorisedDefaultStrategy)}setDefaultOnUnauthorizedStrategy(e){this.isolate?this.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onUnAuthorisedDefaultStrategy=this.configurationStore.onUnAuthorisedDefaultStrategy)}addPermissionStrategy(e,i){this.strategiesSource.value[e]=i}getStrategy(e){return this.strategiesSource.value[e]}getAllStrategies(){return this.strategiesSource.value}getDefinedStrategy(e){if(this.strategiesSource.value[e]||this.isPredefinedStrategy(e))return e;throw new Error(`No ' ${e} ' strategy is found please define one`)}isPredefinedStrategy(e){return e===A.SHOW||e===A.REMOVE}};t.\u0275fac=function(i){return new(i||t)(c(B),c(ee))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();function u(r){return typeof r=="function"}function k(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;{let t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}}function ie(r){return!!r&&typeof r=="string"}function T(r){return typeof r=="boolean"}function te(r){return Object.prototype.toString.call(r)==="[object Promise]"}function O(r){return Array.isArray(r)?r.length>0:!!r}function R(r){return ie(r)?[r]:r}var se=(()=>{let t=class t{constructor(){this.permissionsSource=new d({}),this.permissions$=this.permissionsSource.asObservable()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),W=new E("USE_PERMISSIONS_STORE"),x=(()=>{let t=class t{constructor(e=!1,i){this.isolate=e,this.permissionsStore=i,this.permissionsSource=this.isolate?new d({}):this.permissionsStore.permissionsSource,this.permissions$=this.permissionsSource.asObservable()}flushPermissions(){this.permissionsSource.next({})}hasPermission(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=R(e),this.hasArrayPermission(e))}loadPermissions(e,i){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),{});this.permissionsSource.next(s)}addPermission(e,i){if(Array.isArray(e)){let s=e.reduce((o,n)=>this.reducePermission(o,n,i),this.permissionsSource.value);this.permissionsSource.next(s)}else{let s=this.reducePermission(this.permissionsSource.value,e,i);this.permissionsSource.next(s)}}removePermission(e){let i=l({},this.permissionsSource.value);delete i[e],this.permissionsSource.next(i)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,i,s){return s&&u(s)?v(l({},e),{[i]:{name:i,validationFunction:s}}):v(l({},e),{[i]:{name:i}})}hasArrayPermission(e){let i=e.map(s=>{if(this.hasPermissionValidationFunction(s)){let o=this.permissionsSource.value[s].validationFunction,n=l({},this.permissionsSource.value);return h(null).pipe(S(()=>o(s,n)),j(a=>T(a)?h(a):a),F(()=>h(!1)))}return h(!!this.permissionsSource.value[s])});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&u(this.permissionsSource.value[e].validationFunction)}};t.\u0275fac=function(i){return new(i||t)(c(W),c(se))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),U=class{constructor(){this.rolesSource=new d({}),this.roles$=this.rolesSource.asObservable()}},H=new E("USE_ROLES_STORE"),D=(()=>{let t=class t{constructor(e=!1,i,s){this.isolate=e,this.rolesStore=i,this.permissionsService=s,this.rolesSource=this.isolate?new d({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,i){let s=v(l({},this.rolesSource.value),{[e]:{name:e,validationFunction:i}});this.rolesSource.next(s)}addRoleWithPermissions(e,i){this.permissionsService.addPermission(i),this.addRole(e,i)}addRoles(e){Object.keys(e).forEach((i,s)=>{this.addRole(i,e[i])})}addRolesWithPermissions(e){Object.keys(e).forEach((i,s)=>{this.addRoleWithPermissions(i,e[i])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let i=l({},this.rolesSource.value);delete i[e],this.rolesSource.next(i)}getRoles(){return this.rolesSource.value}getRole(e){return this.rolesSource.value[e]}hasOnlyRoles(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=R(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([s,o])=>s||o))}hasRoleKey(e){let i=e.map(s=>{if(!!this.rolesSource.value[s]&&!!this.rolesSource.value[s].validationFunction&&u(this.rolesSource.value[s].validationFunction)&&!te(this.rolesSource.value[s].validationFunction)){let n=this.rolesSource.value[s].validationFunction,a=l({},this.rolesSource.value);return h(null).pipe(S(()=>n(s,a)),j(P=>T(P)?h(P):P),F(()=>h(!1)))}return h(!1)});return g(i).pipe(I(),y(s=>s!==!1,!1),S(s=>s!==!1)).toPromise().then(s=>s)}hasRolePermission(e,i){return g(i).pipe(m(s=>e[s]&&Array.isArray(e[s].validationFunction)?g(e[s].validationFunction).pipe(m(o=>this.permissionsService.hasPermission(o)),G(o=>o===!0)):h(!1)),y(s=>s===!0,!1)).toPromise()}};t.\u0275fac=function(i){return new(i||t)(c(H),c(U),c(x))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})(),pe=(()=>{let t=class t{constructor(){this.permissionsAuthorized=new V,this.permissionsUnauthorized=new V,this.firstMergeUnusedRun=1,this.permissionsService=p(x),this.configurationService=p($),this.rolesService=p(D),this.viewContainer=p(Q),this.changeDetector=p(q),this.templateRef=p(X)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let i=e.ngxPermissionsOnly,s=e.ngxPermissionsExcept;if(i||s){if(i&&i.firstChange||s&&s.firstChange)return;b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun),L(1)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return b(this.permissionsService.permissions$,this.rolesService.roles$).pipe(M(this.firstMergeUnusedRun)).subscribe(()=>{if(O(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(O(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,i])=>{if(e||i){this.handleUnauthorisedPermission(this.ngxPermissionsExceptElse||this.ngxPermissionsElse);return}if(this.ngxPermissionsOnly)throw!1;this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)}).catch(()=>{this.ngxPermissionsOnly?this.validateOnlyPermissions():this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)})}validateOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsOnly),this.rolesService.hasOnlyRoles(this.ngxPermissionsOnly)]).then(([e,i])=>{e||i?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(T(this.currentAuthorizedState)&&!this.currentAuthorizedState)){if(this.currentAuthorizedState=!1,this.permissionsUnauthorized.emit(),this.getUnAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getUnAuthorizedStrategyInput());return}this.configurationService.onUnAuthorisedDefaultStrategy&&!this.elseBlockDefined()?this.applyStrategy(this.configurationService.onUnAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}handleAuthorisedPermission(e){if(!(T(this.currentAuthorizedState)&&this.currentAuthorizedState)){if(this.currentAuthorizedState=!0,this.permissionsAuthorized.emit(),this.getAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getAuthorizedStrategyInput());return}this.configurationService.onAuthorisedDefaultStrategy&&!this.thenBlockDefined()?this.applyStrategy(this.configurationService.onAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}applyStrategyAccordingToStrategyType(e){if(ie(e)){this.applyStrategy(e);return}if(u(e)){this.showTemplateBlockInView(this.templateRef),e(this.templateRef);return}}showTemplateBlockInView(e){this.viewContainer.clear(),e&&(this.viewContainer.createEmbeddedView(e),this.changeDetector.markForCheck())}getAuthorisedTemplates(){return this.ngxPermissionsOnlyThen||this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef}elseBlockDefined(){return!!this.ngxPermissionsExceptElse||!!this.ngxPermissionsElse}thenBlockDefined(){return!!this.ngxPermissionsExceptThen||!!this.ngxPermissionsThen}getAuthorizedStrategyInput(){return this.ngxPermissionsOnlyAuthorisedStrategy||this.ngxPermissionsExceptAuthorisedStrategy||this.ngxPermissionsAuthorisedStrategy}getUnAuthorizedStrategyInput(){return this.ngxPermissionsOnlyUnauthorisedStrategy||this.ngxPermissionsExceptUnauthorisedStrategy||this.ngxPermissionsUnauthorisedStrategy}applyStrategy(e){if(e===A.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===A.REMOVE){this.viewContainer.clear();return}let i=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),i(this.templateRef)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275dir=J({type:t,selectors:[["","ngxPermissionsOnly",""],["","ngxPermissionsExcept",""]],inputs:{ngxPermissionsOnly:"ngxPermissionsOnly",ngxPermissionsOnlyThen:"ngxPermissionsOnlyThen",ngxPermissionsOnlyElse:"ngxPermissionsOnlyElse",ngxPermissionsExcept:"ngxPermissionsExcept",ngxPermissionsExceptElse:"ngxPermissionsExceptElse",ngxPermissionsExceptThen:"ngxPermissionsExceptThen",ngxPermissionsThen:"ngxPermissionsThen",ngxPermissionsElse:"ngxPermissionsElse",ngxPermissionsOnlyAuthorisedStrategy:"ngxPermissionsOnlyAuthorisedStrategy",ngxPermissionsOnlyUnauthorisedStrategy:"ngxPermissionsOnlyUnauthorisedStrategy",ngxPermissionsExceptUnauthorisedStrategy:"ngxPermissionsExceptUnauthorisedStrategy",ngxPermissionsExceptAuthorisedStrategy:"ngxPermissionsExceptAuthorisedStrategy",ngxPermissionsUnauthorisedStrategy:"ngxPermissionsUnauthorisedStrategy",ngxPermissionsAuthorisedStrategy:"ngxPermissionsAuthorisedStrategy"},outputs:{permissionsAuthorized:"permissionsAuthorized",permissionsUnauthorized:"permissionsUnauthorized"},features:[Y]});let r=t;return r})(),re="default";var _=(()=>{let t=class t{constructor(e,i,s){this.permissionsService=e,this.rolesService=i,this.router=s}canActivate(e,i){return this.hasPermissions(e,i)}canActivateChild(e,i){return this.hasPermissions(e,i)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,i){let s=e&&e.data?e.data.permissions:{},o=this.transformPermission(s,e,i);return this.isParameterAvailable(o.except)?this.passingExceptPermissionsValidation(o,e,i):this.isParameterAvailable(o.only)?this.passingOnlyPermissionsValidation(o,e,i):!0}transformPermission(e,i,s){let o=u(e.only)?e.only(i,s):R(e.only),n=u(e.except)?e.except(i,s):R(e.except),a=e.redirectTo;return{only:o,except:n,redirectTo:a}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,i,s){if(e.redirectTo&&(u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let o="";return g(e.except).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)||(o=n)}))),y(n=>n.some(a=>a===!0),!1),m(n=>o?(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):!n&&e.only?this.onlyRedirectCheck(e,i,s):h(!n))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([o,n])=>o||n?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,i,s),!1):e.only?this.checkOnlyPermissions(e,i,s):!0)}redirectToAnotherRoute(e,i,s,o){let n=u(e)?e(o,i,s):e;if(this.isRedirectionWithParameters(n)){n.navigationCommands=this.transformNavigationCommands(n.navigationCommands,i,s),n.navigationExtras=this.transformNavigationExtras(n.navigationExtras,i,s),this.router.navigate(n.navigationCommands,n.navigationExtras);return}Array.isArray(n)?this.router.navigate(n):this.router.navigate([n])}isRedirectionWithParameters(e){return k(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,i,s){return u(e)?e(i,s):e}transformNavigationExtras(e,i,s){return u(e)?e(i,s):e}onlyRedirectCheck(e,i,s){let o="";return g(e.only).pipe(m(n=>z([this.permissionsService.hasPermission(n),this.rolesService.hasOnlyRoles(n)]).pipe(C(a=>{a.every(w=>w===!1)&&(o=n)}))),y(n=>u(e.redirectTo)?n.some(a=>a===!0):n.every(a=>a===!1),!1),m(n=>u(e.redirectTo)?n?h(!0):(this.handleRedirectOfFailedPermission(e,o,i,s),h(!1)):(o&&this.handleRedirectOfFailedPermission(e,o,i,s),h(!n)))).toPromise()}handleRedirectOfFailedPermission(e,i,s,o){this.isFailedPermissionPropertyOfRedirectTo(e,i)?this.redirectToAnotherRoute(e.redirectTo[i],s,o,i):u(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,s,o,i):this.redirectToAnotherRoute(e.redirectTo[re],s,o,i)}isFailedPermissionPropertyOfRedirectTo(e,i){return!!e.redirectTo&&e.redirectTo[i]}checkOnlyPermissions(e,i,s){let o=l({},e);return Promise.all([this.permissionsService.hasPermission(o.only),this.rolesService.hasOnlyRoles(o.only)]).then(([n,a])=>n||a?!0:(o.redirectTo&&this.redirectToAnotherRoute(o.redirectTo,i,s),!1))}passingOnlyPermissionsValidation(e,i,s){return u(e.redirectTo)||k(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,i,s):this.checkOnlyPermissions(e,i,s)}};t.\u0275fac=function(i){return new(i||t)(c(x),c(D),c(Z))},t.\u0275prov=f({token:t,factory:t.\u0275fac});let r=t;return r})();var ye=(()=>{let t=class t{static forRoot(e={}){return{ngModule:t,providers:[se,U,ee,x,_,D,$,{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:t,providers:[{provide:W,useValue:e.permissionsIsolate},{provide:H,useValue:e.rolesIsolate},{provide:B,useValue:e.configurationIsolate},$,x,D,_]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=N({type:t}),t.\u0275inj=K({});let r=t;return r})();export{x as a,pe as b,ye as c};