marketplacepos 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-P3IVG6BD.js → chunk-23SBJKPP.js} +1 -1
- package/Marketplace/{chunk-WCQU2HIE.js → chunk-2RIYYO3I.js} +2 -2
- package/Marketplace/{chunk-SQR4ZRTF.js → chunk-36GAH775.js} +1 -1
- package/Marketplace/{chunk-3KM6M3SV.js → chunk-3CF7HOB3.js} +1 -1
- package/Marketplace/{chunk-TBOHCD6E.js → chunk-52UFYFEM.js} +1 -1
- package/Marketplace/{chunk-RUB4SQ54.js → chunk-5PIRWI5F.js} +1 -1
- package/Marketplace/{chunk-ECAAF5I6.js → chunk-6GF6XSWZ.js} +1 -1
- package/Marketplace/{chunk-4HJGWXQ3.js → chunk-7NZIFRTH.js} +1 -1
- package/Marketplace/{chunk-I5POPG3M.js → chunk-A2WAKRJC.js} +1 -1
- package/Marketplace/{chunk-YILL4GKX.js → chunk-BFNB4J5W.js} +1 -1
- package/Marketplace/{chunk-UW4B35JC.js → chunk-BJBDPG47.js} +1 -1
- package/Marketplace/{chunk-NN3SPEH5.js → chunk-C3TFPYXX.js} +1 -1
- package/Marketplace/{chunk-XDU5GZAR.js → chunk-C7TRF3SY.js} +2 -2
- package/Marketplace/{chunk-6NPWPFG3.js → chunk-CNCAKULD.js} +1 -1
- package/Marketplace/{chunk-4PF4YRRT.js → chunk-CNKB33H4.js} +1 -1
- package/Marketplace/{chunk-FBXFQ4G2.js → chunk-DHJDNOMM.js} +9 -9
- package/Marketplace/{chunk-ORA63EP5.js → chunk-F2X2FB6J.js} +1 -1
- package/Marketplace/{chunk-OV2NRCQ5.js → chunk-F5ZJBCUU.js} +1 -1
- package/Marketplace/{chunk-POSHHHMT.js → chunk-F7TBBOWO.js} +1 -1
- package/Marketplace/{chunk-SHX3JAGT.js → chunk-FTHNPPXM.js} +1 -1
- package/Marketplace/{chunk-KB7PR6DP.js → chunk-GR67GFTL.js} +1 -1
- package/Marketplace/{chunk-6D7NMKRE.js → chunk-GTSE6GZT.js} +1 -1
- package/Marketplace/{chunk-WOHUGR5B.js → chunk-H57B7P7N.js} +1 -1
- package/Marketplace/{chunk-7MM3ONJ5.js → chunk-IWREFJGX.js} +1 -1
- package/Marketplace/{chunk-ZMC2DAP2.js → chunk-JJLMXJYI.js} +1 -1
- package/Marketplace/{chunk-O3IHPLVP.js → chunk-JJPZKFSE.js} +1 -1
- package/Marketplace/{chunk-L7Q6GF26.js → chunk-JUI6EOAN.js} +1 -1
- package/Marketplace/{chunk-XLZ3ZJTK.js → chunk-L35RXBHK.js} +1 -1
- package/Marketplace/{chunk-ULR2QT4D.js → chunk-LDGVYQDZ.js} +1 -1
- package/Marketplace/{chunk-32LBRSCJ.js → chunk-LDMABSVE.js} +1 -1
- package/Marketplace/chunk-LKQ6EHTZ.js +1 -0
- package/Marketplace/{chunk-VCLTTDX7.js → chunk-MWO3MHRT.js} +1 -1
- package/Marketplace/{chunk-HT7RDS3I.js → chunk-NIH5QHYK.js} +1 -1
- package/Marketplace/{chunk-LAEELPPC.js → chunk-ODAO6UI4.js} +1 -1
- package/Marketplace/{chunk-BLMEJMMZ.js → chunk-ODJ4UZGV.js} +1 -1
- package/Marketplace/{chunk-2WK2VI24.js → chunk-OIUZMXWP.js} +1 -1
- package/Marketplace/{chunk-JYZZ37SG.js → chunk-OIV2KTCZ.js} +1 -1
- package/Marketplace/{chunk-3SVOLAII.js → chunk-OM4EEQPS.js} +1 -1
- package/Marketplace/{chunk-FA44W5LU.js → chunk-P24WVMWI.js} +1 -1
- package/Marketplace/{chunk-PZX3AESM.js → chunk-PLNXC7LP.js} +1 -1
- package/Marketplace/{chunk-SOPDRQWM.js → chunk-QOGXVEGW.js} +1 -1
- package/Marketplace/{chunk-WKDJS327.js → chunk-QUSBGNEW.js} +1 -1
- package/Marketplace/{chunk-NJM2XHQY.js → chunk-QZFQKQ7J.js} +1 -1
- package/Marketplace/{chunk-GR5OKYJS.js → chunk-RONMO7FE.js} +1 -1
- package/Marketplace/{chunk-YGL3QYTJ.js → chunk-U53TPHQS.js} +1 -1
- package/Marketplace/{chunk-PNLW4YVH.js → chunk-UCVQS5HR.js} +1 -1
- package/Marketplace/chunk-UWJWLXE2.js +1 -0
- package/Marketplace/{chunk-L6CJT6UC.js → chunk-V3UGRPNZ.js} +1 -1
- package/Marketplace/{chunk-7RTQ2IDL.js → chunk-VXL3UMDN.js} +1 -1
- package/Marketplace/{chunk-35L7AOGR.js → chunk-WIQODYPX.js} +1 -1
- package/Marketplace/{chunk-SQGOM2WU.js → chunk-WZCMEPBS.js} +1 -1
- package/Marketplace/{chunk-OZKNF6S2.js → chunk-XB2UHCVJ.js} +1 -1
- package/Marketplace/{chunk-FDI2UIO2.js → chunk-XDLTNTVT.js} +1 -1
- package/Marketplace/{chunk-ZRFFM47Q.js → chunk-Z3NC34XH.js} +1 -1
- package/Marketplace/{chunk-7KXQRJHI.js → chunk-Z5U5IBQC.js} +1 -1
- package/Marketplace/chunk-ZDNNLDAI.js +5 -0
- package/Marketplace/{chunk-KPPQNI2R.js → chunk-ZQYW374F.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-525IC5TZ.js → main-B2USSC5L.js} +1 -1
- package/Marketplace/{styles-SUQABHBL.css → styles-UF4D57IG.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-LBQ2LOYA.js +0 -1
- package/Marketplace/chunk-QTQ6GNKJ.js +0 -5
- package/Marketplace/chunk-SUMLYFC7.js +0 -1
- /package/Marketplace/{chunk-4RJDBICZ.js → chunk-KG5K5AND.js} +0 -0
- /package/Marketplace/{chunk-ZKZWHDGN.js → chunk-PUBPICPK.js} +0 -0
- /package/Marketplace/{chunk-OOD7TLAL.js → chunk-UWYERBYV.js} +0 -0
- /package/Marketplace/{polyfills-ZMM4NOHE.js → polyfills-UZ2JZAXP.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ze}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-4RJDBICZ.js";import{a as Ke,b as Ge,c as He}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-WKDJS327.js";import{a as N,b as fe,c as xe,d as ve,e as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-32LBRSCJ.js";import{a as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-BLMEJMMZ.js";import{b as Je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-PNLW4YVH.js";import{a as Ze,b as qe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-WOHUGR5B.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OOD7TLAL.js";import{a as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZRFFM47Q.js";import{a as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-YILL4GKX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OV2NRCQ5.js";import{a as Ae,b as je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-3KM6M3SV.js";import{a as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-TBOHCD6E.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-KPPQNI2R.js";import{a as ke,b as Oe,d as $e,e as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SOPDRQWM.js";import{a as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NJM2XHQY.js";import{d as K,k as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-XDU5GZAR.js";import{a as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-L6CJT6UC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SHX3JAGT.js";import{B as Be,C as J,D as Ue,q as ue,r as Re,u as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SQR4ZRTF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NN3SPEH5.js";import{b as ce,c as se,h as M,k as F,m as pe,u as me,v as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FDI2UIO2.js";import{c as z,e as _e,f as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-7RTQ2IDL.js";import{$a as l,Aa as V,Ac as le,B as k,Fb as v,Ga as r,Gb as S,Ha as b,Hb as re,La as De,Ob as W,Q as te,Qa as s,Wa as d,X as O,_b as $,aa as ne,ab as c,ac as L,bb as P,bc as R,cb as y,db as w,ea as D,ec as B,fa as ie,fb as x,hc as U,ic as A,ja as _,jb as h,ka as g,lb as p,ob as ae,q as Y,qb as Q,rb as m,sb as E,tb as I,ub as oe,wb as Ee,wc as Me,yb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZKZWHDGN.js";function mt(i,o){if(i&1){let t=x();l(0,"button",18),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.onUpdateItems(n))}),P(1,"i",19),m(2," Update "),c()}}function dt(i,o){if(i&1&&(l(0,"div"),d(1,mt,3,0,"button",17),c()),i&2){let t=o.ngIf,e=p(2);r(1),s("ngIf",e.productService.hasSelectionVariant(t))}}function _t(i,o){if(i&1){let t=x();l(0,"div",20)(1,"app-table",21),h("onToggle",function(n){_(t);let a=p(2);return g(a.onShowDifferencePrice(n))})("onSubmit",function(n){_(t);let a=p(2);return g(a.updatePriceByVariant(n))}),v(2,"async"),c()()}if(i&2){let t=p().ngIf,e=p();r(1),s("showProductToggle",!0)("data",S(2,4,e.paginationService.data$))("channel",e.channelOptions)("filter",t.Filter)}}function gt(i,o){if(i&1){let t=x();l(0,"span",22),h("click",function(){_(t);let n=p(2);return g(n.getRowCount())}),l(1,"i",23),m(2,"?"),c()()}}function ut(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function ht(i,o){if(i&1){let t=x();l(0,"a",24),h("click",function(){_(t);let n=p(2);return g(n.onNextPage())}),P(1,"i",25),m(2," Next"),c()}}function Ct(i,o){if(i&1){let t=x();l(0,"a",26),h("click",function(){_(t);let n=p(2);return g(n.onLastPage())}),P(1,"i",27),m(2," Last"),c()}}function ft(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("onSubmit",function(n){_(t);let a=p();return g(a.onSearch(n))}),l(1,"actions")(2,"div",2),d(3,dt,2,1,"div",3),v(4,"async"),c()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Page Number"),c(),l(9,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(10,"div",6)(11,"label",4),m(12,"Page Size"),c(),l(13,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),l(14,"content")(15,"div",7)(16,"div",8),d(17,_t,3,6,"div",9),v(18,"async"),c(),l(19,"div",10)(20,"div",11)(21,"div",12),m(22),v(23,"number"),v(24,"async"),d(25,gt,3,0,"span",13)(26,ut,3,3,"span",3),v(27,"async"),m(28),c()(),l(29,"div",14),d(30,ht,3,0,"a",15)(31,Ct,3,0,"a",16),c()()()()()}if(i&2){let t=p(),e;s("pageData",t.pageData)("textButton","Search"),r(3),s("ngIf",S(4,12,t.paginationService.data$)),r(6),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(4),s("ngIf",S(18,14,t.paginationService.data$)),r(5),I(" Showing 1 - ",S(23,16,(e=S(24,18,t.paginationService.data$))==null?null:e.length)," of "),r(3),s("ngIf",t.paginationService.hideCount),r(1),s("ngIf",!t.paginationService.hideCount&&S(27,20,t.allDataCount$)),r(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),r(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}var it=(()=>{let o=class o{constructor(e,n,a,u,C,f){this.http=e,this.toastr=n,this.dialog=a,this.paginationService=u,this.productService=C,this.authService=f,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(O(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let u=n.map(f=>({ID:f.ID,Code:f.Code,Price:f.UnitPrice}));var a=this.channelOptions.filter(f=>f.selected).map(f=>f.ID);let C={ListChannelID:a,ListPrice:u};this.http.post("/api/Price/UpdateChannel",C).subscribe(f=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+C.ListPrice.length+" items in "+C.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(a=>{let u=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+u.Name+" to "+n.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>a!==void 0)).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(q),b(Z),b(G))},o.\u0275cmp=D({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,ft,32,22,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[R,se,pe,M,F,J,ve,B,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function xt(i,o){if(i&1&&(l(0,"mat-radio-button",3),m(1),c()),i&2){let t=o.$implicit,e=o.index,n=p();s("value",t.Key)("name",n.name)("title",n.tooltipsText[e]?n.tooltipsText[e]:""),r(1),I(" ",t.Value,"")}}var vt=i=>({"border-0 rounded":i}),Pe=(()=>{let o=class o{constructor(){this.modelChange=new De,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Ee],decls:3,vars:5,consts:[[1,"form-control","h-100","rounded-1",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,a){n&1&&(l(0,"div",0)(1,"mat-radio-group",1),h("ngModelChange",function(C){return a.change(C)}),d(2,xt,2,4,"mat-radio-button",2),c()()),n&2&&(s("ngClass",T(3,vt,a.border==!1)),r(1),s("ngModel",a.model),r(1),s("ngForOf",a.options))},dependencies:[A,$,L,He,Ke,Ge,me,M,F],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=o;return i})();function wt(i,o){if(i&1){let t=x();y(0),l(1,"div")(2,"label",23),m(3,"Filter by"),c(),l(4,"radio-options",24),h("modelChange",function(n){_(t);let a=p();return g(a.filterType=n)}),c()(),w()}if(i&2){let t=p();r(4),s("model",t.filterType)("options",t.filterTypeOptions)("border",!0)}}function Tt(i,o){if(i&1){let t=x();l(0,"button",27),h("click",function(){_(t);let n=p().ngIf,a=p();return g(a.onUpdateItems(n))}),P(1,"i",28),m(2," Update "),c()}}function Vt(i,o){if(i&1&&(y(0),l(1,"div",25),d(2,Tt,3,0,"button",26),c(),w()),i&2){let t=o.ngIf,e=p();r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Dt(i,o){if(i&1&&(l(0,"th",29)(1,"div",30),P(2,"img",31),l(3,"div",32),m(4),v(5,"stringLimit"),c()()()),i&2){let t=o.$implicit;r(1),s("matTooltip",(t.Name==null?null:t.Name.length)>20?t.Name:""),r(1),s("src",t==null?null:t.Img,V),r(2),oe("",re(5,4,t.Name,20),"",(t.Name==null?null:t.Name.length)>20?"...":"","")}}function Et(i,o){if(i&1){let t=x();l(0,"th")(1,"input",33),h("ngModelChange",function(n){_(t);let a=p();return g(a.checkboxState=n)})("ngModelChange",function(){_(t);let n=p();return g(n.onSelectAllData())}),c()()}if(i&2){let t=p();r(1),s("ngModel",t.checkboxState)}}function Mt(i,o){i&1&&(y(0),l(1,"th",34)(2,"span"),m(3,"Expected"),c(),l(4,"span",35),m(5,"(POS)"),c()(),l(6,"th",34),m(7," Channel "),c(),w())}function Ft(i,o){if(i&1){let t=x();l(0,"img",48),h("click",function(n){_(t);let a=p(3).$implicit,u=p(2);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c()}if(i&2){let t=p(3).$implicit;ae("src",t==null?null:t.ImageUrl,V)}}function Nt(i,o){i&1&&P(0,"img",49)}var kt=i=>({"border-bottom":i});function Ot(i,o){if(i&1&&(y(0),l(1,"td",42),d(2,Ft,1,1,"img",43)(3,Nt,1,0,"ng-template",null,44,W),c(),l(5,"td",45)(6,"h5",46),m(7),c(),l(8,"small",47),m(9),c()(),w()),i&2){let t=Q(4),e=p().index,n=p().$implicit,a=p().ngIf;r(1),s("rowSpan",n==null?null:n.Variants.length)("ngClass",T(7,kt,e+1==a.length)),r(1),s("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),s("rowSpan",n==null?null:n.Variants.length),r(2),E(n==null?null:n.Name),r(2),I("(",n==null?null:n.Category,")")}}function $t(i,o){if(i&1){let t=x();l(0,"td",50)(1,"input",33),h("ngModelChange",function(n){_(t);let a=p().$implicit;return g(a.selected=n)}),c()()}if(i&2){let t=p().$implicit;r(1),s("ngModel",t.selected)}}var Lt=i=>({"bg-gradient-warning":i});function Rt(i,o){if(i&1){let t=x();y(0),l(1,"td",53),m(2),v(3,"number"),c(),l(4,"td",54),h("click",function(){let a=_(t).$implicit,u=p(2).$implicit,C=p().$implicit,f=p(2);return g(f.openTableDialog(u,C,a))}),l(5,"div",55)(6,"div",56),m(7),v(8,"number"),c(),l(9,"a",57),h("click",function(n){return n==null?null:n.stopPropagation()}),P(10,"i",41),c()()(),w()}if(i&2){let t=o.$implicit;r(2),I(" ",S(3,4,t.PriceExpected)," "),r(2),s("ngClass",T(8,Lt,t.Price!=t.PriceExpected)),r(3),I(" ",S(8,6,t.Price)," "),r(2),s("href",t.Url,V)}}function Bt(i,o){i&1&&(l(0,"td",58),m(1,"X"),c(),l(2,"td",58),m(3,"X"),c())}function Ut(i,o){if(i&1&&(y(0),d(1,Rt,11,10,"ng-container",51)(2,Bt,4,0,"ng-template",null,52,W),w()),i&2){let t=o.$implicit,e=Q(3),n=p().$implicit,a=p(3);r(1),s("ngIf",a.getItemFromChannel(n,t.ID))("ngIfElse",e)}}var At=i=>({"text-decoration-line-through":i}),at=i=>[i];function jt(i,o){if(i&1&&(l(0,"tr"),d(1,Ot,10,9,"ng-container",1),l(2,"td",36),m(3),c(),l(4,"td",37)(5,"div",38)(6,"div",39),m(7),c(),l(8,"div",32)(9,"a",40),P(10,"i",41),c()()()(),d(11,$t,2,1,"ng-template",14)(12,Ut,4,2,"ng-container",15),c()),i&2){let t=o.$implicit,e=o.index,n=p(3);r(1),s("ngIf",e==0),r(2),E(t==null?null:t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(2),s("ngClass",T(8,At,t.isDiscontinued)),r(1),I(" ",t==null?null:t.Code,""),r(2),s("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V),r(2),s("ngxPermissionsOnly",T(10,at,n.rolePriceEdit)),r(1),s("ngForOf",n.channelOptions)}}function zt(i,o){if(i&1&&(l(0,"tbody"),d(1,jt,13,12,"tr",15),c()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Kt(i,o){if(i&1&&(y(0),d(1,zt,2,1,"tbody",15),w()),i&2){let t=o.ngIf;r(1),s("ngForOf",t)}}function Gt(i,o){if(i&1){let t=x();l(0,"span",59),h("click",function(){_(t);let n=p();return g(n.getRowCount())}),l(1,"i",60),m(2,"?"),c()()}}function Ht(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function Jt(i,o){if(i&1){let t=x();l(0,"a",61),h("click",function(){_(t);let n=p();return g(n.onNextPage())}),P(1,"i",62),m(2," Next"),c()}}function Zt(i,o){if(i&1){let t=x();l(0,"a",63),h("click",function(){_(t);let n=p();return g(n.onLastPage())}),P(1,"i",64),m(2," Last"),c()}}var ot=(()=>{let o=class o{constructor(e,n,a,u,C,f,be){this.http=e,this.toastr=n,this.dialog=a,this.productService=u,this.authService=C,this.biggerPictureService=f,this.paginationService=be,this.searchFilter=new ze,this.checkboxState=!1,this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:N.ALL,Value:"All"},{Key:N.DIFFERENCE,Value:"Difference"}],this.filterType=N.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.paginationService.fetchDataEndpoint="Price/GetOutletPrice",this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.paginationService.data$.pipe(Y(e=>(e=e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=a.Discontinued=="Yes",a))),n)),e)),te(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(O(e=>{this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{}).pipe(O(e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}))}getRowCount(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{})}onSelectAllData(){this.data$=this.data$.pipe(Y(e=>(e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a))),n)),e)))}onFilter(e){let n={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.paginationService.reloadPagination(n)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let a=n.map(f=>f.ID),C={ListChannelID:this.channelOptions.filter(f=>f.selected).map(f=>f.ID),ListID:a};this.http.post("/api/Price/UpdateChannelOutletPrice",C).subscribe({next:f=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+C.ListID.length+" items in "+C.ListChannelID.length+" channels","Success")},error:f=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,n){return e.Channel.find(a=>a.ChannelID==n)}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>z.IsNotEmpty(a))).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateProductPrice(f,a)})}updateProductPrice(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{n.Price=a.Price;let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success")})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(Z),b(G),b(he),b(q))},o.\u0275cmp=D({type:o,selectors:[["app-custom-channel-price"]],decls:42,vars:30,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2","class","w-100","class","text-center border-bottom-0 border text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"fw-bold","mb-2"],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){if(n&1&&(l(0,"mainpanel",0),h("onSubmit",function(C){return a.onFilter(C)}),l(1,"filters"),d(2,wt,5,3,"ng-container",1),v(3,"async"),c(),l(4,"actions"),d(5,Vt,3,1,"ng-container",1),v(6,"async"),c(),l(7,"content")(8,"div",2)(9,"div",3)(10,"div",4)(11,"div",5)(12,"table",6)(13,"thead",7)(14,"tr",8),P(15,"th",9),d(16,Dt,6,7,"th",10),c(),l(17,"tr")(18,"th",11)(19,"span"),m(20," Product "),c()(),l(21,"th",12),m(22,"Variant"),c(),l(23,"th",13),m(24,"SKU"),c(),d(25,Et,2,1,"ng-template",14)(26,Mt,8,0,"ng-container",15),c()(),d(27,Kt,2,1,"ng-container",1),v(28,"async"),c()()()(),l(29,"div",16)(30,"div",17)(31,"div",18),m(32),v(33,"number"),v(34,"async"),d(35,Gt,3,0,"span",19)(36,Ht,3,3,"span",1),v(37,"async"),m(38),c()(),l(39,"div",20),d(40,Jt,3,0,"a",21)(41,Zt,3,0,"a",22),c()()()()()),n&2){let u;s("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",S(3,16,a.loader$)),r(3),s("ngIf",S(6,18,a.data$)),r(11),s("ngForOf",a.channelOptions),r(9),s("ngxPermissionsOnly",T(28,at,a.rolePriceEdit)),r(1),s("ngForOf",a.channelOptions),r(1),s("ngIf",S(28,20,a.data$)),r(5),I(" Showing 1 - ",S(33,22,(u=S(34,24,a.paginationService.data$))==null?null:u.length)," of "),r(3),s("ngIf",a.paginationService.hideCount),r(1),s("ngIf",!a.paginationService.hideCount&&S(37,26,a.totalData$)),r(2),I(" records ~ ",a.paginationService.footerPageNumber," Page "),r(2),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage),r(1),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage)}},dependencies:[$,L,R,ce,M,F,J,ue,Pe,_e,B,U,xe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let i=o;return i})();function qt(i,o){if(i&1&&(l(0,"span",9),P(1,"img",10),c(),m(2)),i&2){let t=o.item;r(1),s("src",t==null?null:t.Img,V),r(1),I(" ",t.Name," ")}}function Xt(i,o){if(i&1){let t=x();l(0,"button",13),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.updateStock(n))}),P(1,"i",14),m(2," Update "),c()}}function Yt(i,o){if(i&1&&(l(0,"actions")(1,"div",11),d(2,Xt,3,0,"button",12),c()()),i&2){let t=o.ngIf,e=p(2);r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Qt(i,o){if(i&1){let t=x();l(0,"th")(1,"input",34),h("change",function(n){_(t);let a=p().ngIf,u=p(2);return g(u.onSelectAllSKU(n.target.checked,a))}),c()()}}function Wt(i,o){if(i&1){let t=x();l(0,"input",52),h("ngModelChange",function(n){_(t);let a=p(4).$implicit;return g(a.selected=n)})("ngModelChange",function(){_(t);let n=p(4).$implicit,a=p(3);return g(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=p(4).$implicit;s("ngModel",t.selected)}}var Te=i=>[i];function en(i,o){if(i&1&&(y(0),d(1,Wt,1,1,"ng-template",23),w()),i&2){let t=p(6);r(1),s("ngxPermissionsOnly",T(1,Te,t.rolePriceEdit))}}function tn(i,o){if(i&1){let t=x();y(0),l(1,"img",53),h("click",function(n){_(t);let a=p(3).$implicit,u=p(3);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),w()}if(i&2){let t=p(3).$implicit;r(1),ae("src",t.ThumbnailUrl,V)}}function nn(i,o){i&1&&P(0,"img",54)}function an(i,o){if(i&1&&(y(0),P(1,"br"),l(2,"small"),m(3),c(),w()),i&2){let t=p(3).$implicit;r(3),I("(",t.Category,")")}}var on=i=>({"ms-10":i});function rn(i,o){if(i&1&&(y(0),l(1,"td",46)(2,"div",47),d(3,en,2,3,"ng-container",8),l(4,"div",36),d(5,tn,2,1,"ng-container",48)(6,nn,1,0,"ng-template",null,49,W),c()()(),l(8,"td",50)(9,"span",51),m(10),c(),d(11,an,4,1,"ng-container",8),c(),w()),i&2){let t=Q(7),e=p(2).$implicit,n=p(3);r(1),s("rowSpan",e.Variants.length),r(2),s("ngIf",(e.Variants==null?null:e.Variants.length)>1),r(1),s("ngClass",T(8,on,(e.Variants==null?null:e.Variants.length)<=1)),r(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",t),r(3),s("rowSpan",e.Variants.length),r(2),E(e.Name),r(1),s("ngIf",(e==null?null:e.CategoryID)!==null&&(e==null?null:e.CategoryID)!=n.guidEmpty)}}function ln(i,o){if(i&1){let t=x();l(0,"input",57),h("ngModelChange",function(n){_(t);let a=p(2).$implicit;return g(a.selected=n)}),c()}if(i&2){let t=p(2).$implicit;s("ngModel",t.selected)}}function cn(i,o){if(i&1&&(l(0,"td",55),d(1,ln,1,1,"input",56),c()),i&2){let t=p().$implicit;r(1),s("ngIf",t.Inventory>=0)}}function sn(i,o){i&1&&(l(0,"div",58),m(1,"Not Found"),c())}function pn(i,o){if(i&1&&(l(0,"div"),m(1),v(2,"number"),c()),i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.UnitPrice),"")}}function mn(i,o){if(i&1&&(y(0),l(1,"div",41)(2,"a",42),P(3,"i",59),c()(),w()),i&2){let t=p().$implicit,e=p(4);r(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function dn(i,o){if(i&1){let t=x();l(0,"div",60),h("click",function(){_(t);let n=p().$implicit,a=p().$implicit,u=p(2).ngIf,C=p();return g(C.openTableDialog(n,a,u))}),m(1),v(2,"number"),c()}if(i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}var _n=i=>({"text-decoration-line-through":i}),gn=i=>({"bg-gradient-warning":i});function un(i,o){if(i&1){let t=x();l(0,"tr"),d(1,rn,12,10,"ng-container",8),l(2,"td",21),m(3),c(),l(4,"td",35)(5,"span",36),m(6),c()(),d(7,cn,2,1,"ng-template",23),l(8,"td",24)(9,"div",37),d(10,sn,2,0,"div",38)(11,pn,3,3,"div",8)(12,mn,4,1,"ng-container",8),c()(),l(13,"td",39)(14,"div",37),d(15,dn,3,3,"div",40),l(16,"div",41)(17,"a",42),P(18,"i",43),c()(),l(19,"div",41)(20,"div",44),h("click",function(){let a=_(t).$implicit,u=p(4);return g(u.refreshPrice(a))}),P(21,"i",45),c()()()()()}if(i&2){let t=o.$implicit,e=o.index,n=p(4);r(1),s("ngIf",e==0),r(2),E(t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(1),s("ngClass",T(12,_n,t.isDiscontinued)),r(1),I(" ",t.Code," "),r(1),s("ngxPermissionsOnly",T(14,Te,n.rolePriceEdit)),r(3),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)!=null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngClass",T(16,gn,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),r(2),s("ngIf",t.Channel.length>0),r(2),s("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function hn(i,o){if(i&1&&(y(0),d(1,un,22,18,"tr",28),w()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Cn(i,o){if(i&1){let t=x();l(0,"span",60),h("click",function(){_(t);let n=p(3);return g(n.getRowCount())}),l(1,"i",61),m(2,"?"),c()()}}function fn(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t.Total))}}function xn(i,o){if(i&1){let t=x();l(0,"a",65),h("click",function(){_(t);let n=p(4);return g(n.onNextPage())}),P(1,"i",66),m(2," Next"),c()}}function vn(i,o){if(i&1){let t=x();l(0,"a",67),h("click",function(){_(t);let n=p(4);return g(n.onLastPage())}),P(1,"i",68),m(2," Last"),c()}}function Sn(i,o){if(i&1&&(l(0,"div",62),d(1,xn,3,0,"a",63)(2,vn,3,0,"a",64),c()),i&2){let t=p(3);r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Pn(i,o){if(i&1){let t=x();l(0,"content")(1,"div",15)(2,"div",16)(3,"table",17)(4,"thead",18)(5,"tr")(6,"th",19),m(7," Product "),l(8,"div")(9,"mat-slide-toggle",20),h("ngModelChange",function(n){_(t);let a=p(2);return g(a.toggleDifferentInventory=n)})("toggleChange",function(){_(t);let n=p(2);return g(n.onToggleDifferentInventory())}),l(10,"small",6),m(11,"FILTER DIFFERENT PRICE"),c()()()(),l(12,"th",21),m(13,"Variant"),c(),l(14,"th",22),m(15,"SKU"),c(),d(16,Qt,2,0,"ng-template",23),l(17,"th",24),m(18,"POS"),c(),l(19,"th",24)(20,"div",25),h("click",function(){_(t);let n=p(2);return g(n.openModalFilter())}),P(21,"img",26),l(22,"span",27),m(23),v(24,"stringLimit"),c()()()()(),l(25,"tbody"),d(26,hn,2,1,"ng-container",28),c()(),l(27,"div",29)(28,"div",30)(29,"div",31),m(30),v(31,"number"),d(32,Cn,3,0,"span",32)(33,fn,3,3,"span",8),v(34,"async"),m(35),c()(),d(36,Sn,3,2,"div",33),c()()()()}if(i&2){let t=o.ngIf,e=p(2);r(9),s("ngModel",e.toggleDifferentInventory),r(7),s("ngxPermissionsOnly",T(19,Te,e.rolePriceEdit)),r(4),s("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),s("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),r(2),oe(" ",re(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),r(3),s("ngForOf",t),r(4),I(" Showing 1 - ",S(31,15,t==null?null:t.length)," of "),r(2),s("ngIf",e.paginationService.hideCount),r(1),s("ngIf",S(34,17,!e.paginationService.hideCount&&e.allDataCount$)),r(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),s("ngIf",t.length>0)}}function bn(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("textChange",function(n){_(t);let a=p();return g(a.searchFilter.text=n)})("onSubmit",function(){_(t);let n=p();return g(n.onSearch())}),l(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),c(),l(5,"ng-select",3),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.ChannelID=n)}),d(6,qt,3,2,"ng-template",4),c()(),l(7,"div",5)(8,"label",6),m(9,"Page Number"),c(),l(10,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(11,"div",5)(12,"label",6),m(13,"Page Size"),c(),l(14,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),d(15,Yt,3,1,"actions",8),v(16,"async"),d(17,Pn,37,21,"content",8),v(18,"async"),c()}if(i&2){let t=p();s("headerTitle",t.pageTitle)("text",t.searchFilter.text),r(5),s("clearable",!1)("items",t.channelOptions)("ngModel",t.searchFilter.ChannelID),r(5),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(1),s("ngIf",S(16,9,t.data$)),r(2),s("ngIf",S(18,11,t.data$))}}var rt=(()=>{let o=class o{constructor(e,n,a,u,C,f,be,Ve,st){this.http=e,this.paginationService=n,this.toastr=a,this.dialog=u,this.productService=C,this.biggerPictureService=f,this.inventoryService=be,this.authService=Ve,this.mainPanelService=st,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=z.GuidEMpty,this.hostName=this.authService.getDomain(),this.data$=this.paginationService.data$.pipe(te(1),Y(pt=>pt.map(ee=>(ee.Variants&&(ee.Variants=ee.Variants.map(Ie=>(Ie.isDiscontinued=Ie.Discontinued=="Yes",Ie))),ee)))),this.channelOptions=Ve.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(O(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=N.ALL,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),u={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",u).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:u?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:u?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(u=>(u.selected=e,u)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(q),b(K),b(H),b(Z),b(he),b(Se),b(G),b(Be))},o.\u0275cmp=D({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"ms-1"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,bn,19,13,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[$,L,R,se,pe,ce,M,F,J,$e,ke,Oe,Ze,ue,_e,B,U,xe],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=o;return i})();var lt=(()=>{let o=class o{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),P(3,"nav-tab",2),c()()(),P(4,"router-outlet")),n&2&&(r(3),s("Tabs",a.priceTabs))},dependencies:[Ae,Me]});let i=o;return i})();var In=[{path:"",component:lt,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:it,canActivate:[ge],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:ot,canActivate:[ge],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:rt,canActivate:[ge],data:{title:"Price Single Channel Comparison"}}]}],ct=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({imports:[A,le.forChild(In)]});let i=o;return i})();var $i=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({providers:[Se],imports:[A,me,je,Ue,le,Le,ct,Fe,qe,Je,Re,Pe,ve,Ne.forChild()]});let i=o;return i})();export{$i as PriceModule};
|
|
1
|
+
import{a as ze}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-KG5K5AND.js";import{a as Ke,b as Ge,c as He}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-QUSBGNEW.js";import{a as N,b as fe,c as xe,d as ve,e as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-LDMABSVE.js";import{a as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-ODJ4UZGV.js";import{b as Je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-UCVQS5HR.js";import{a as Ze,b as qe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-H57B7P7N.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-UWYERBYV.js";import{a as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-Z3NC34XH.js";import{a as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-BFNB4J5W.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-F5ZJBCUU.js";import{a as Ae,b as je}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-3CF7HOB3.js";import{a as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-52UFYFEM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-ZQYW374F.js";import{a as ke,b as Oe,d as $e,e as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-QOGXVEGW.js";import{a as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-QZFQKQ7J.js";import{d as K,k as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-C7TRF3SY.js";import{a as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-V3UGRPNZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-FTHNPPXM.js";import{B as Be,C as J,D as Ue,q as ue,r as Re,u as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-36GAH775.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-C3TFPYXX.js";import{b as ce,c as se,h as M,k as F,m as pe,u as me,v as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-XDLTNTVT.js";import{c as z,e as _e,f as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-VXL3UMDN.js";import{$a as l,Aa as V,Ac as le,B as k,Fb as v,Ga as r,Gb as S,Ha as b,Hb as re,La as De,Ob as W,Q as te,Qa as s,Wa as d,X as O,_b as $,aa as ne,ab as c,ac as L,bb as P,bc as R,cb as y,db as w,ea as D,ec as B,fa as ie,fb as x,hc as U,ic as A,ja as _,jb as h,ka as g,lb as p,ob as ae,q as Y,qb as Q,rb as m,sb as E,tb as I,ub as oe,wb as Ee,wc as Me,yb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-P24WVMWI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-PUBPICPK.js";function mt(i,o){if(i&1){let t=x();l(0,"button",18),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.onUpdateItems(n))}),P(1,"i",19),m(2," Update "),c()}}function dt(i,o){if(i&1&&(l(0,"div"),d(1,mt,3,0,"button",17),c()),i&2){let t=o.ngIf,e=p(2);r(1),s("ngIf",e.productService.hasSelectionVariant(t))}}function _t(i,o){if(i&1){let t=x();l(0,"div",20)(1,"app-table",21),h("onToggle",function(n){_(t);let a=p(2);return g(a.onShowDifferencePrice(n))})("onSubmit",function(n){_(t);let a=p(2);return g(a.updatePriceByVariant(n))}),v(2,"async"),c()()}if(i&2){let t=p().ngIf,e=p();r(1),s("showProductToggle",!0)("data",S(2,4,e.paginationService.data$))("channel",e.channelOptions)("filter",t.Filter)}}function gt(i,o){if(i&1){let t=x();l(0,"span",22),h("click",function(){_(t);let n=p(2);return g(n.getRowCount())}),l(1,"i",23),m(2,"?"),c()()}}function ut(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function ht(i,o){if(i&1){let t=x();l(0,"a",24),h("click",function(){_(t);let n=p(2);return g(n.onNextPage())}),P(1,"i",25),m(2," Next"),c()}}function Ct(i,o){if(i&1){let t=x();l(0,"a",26),h("click",function(){_(t);let n=p(2);return g(n.onLastPage())}),P(1,"i",27),m(2," Last"),c()}}function ft(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("onSubmit",function(n){_(t);let a=p();return g(a.onSearch(n))}),l(1,"actions")(2,"div",2),d(3,dt,2,1,"div",3),v(4,"async"),c()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Page Number"),c(),l(9,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(10,"div",6)(11,"label",4),m(12,"Page Size"),c(),l(13,"input",5),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),l(14,"content")(15,"div",7)(16,"div",8),d(17,_t,3,6,"div",9),v(18,"async"),c(),l(19,"div",10)(20,"div",11)(21,"div",12),m(22),v(23,"number"),v(24,"async"),d(25,gt,3,0,"span",13)(26,ut,3,3,"span",3),v(27,"async"),m(28),c()(),l(29,"div",14),d(30,ht,3,0,"a",15)(31,Ct,3,0,"a",16),c()()()()()}if(i&2){let t=p(),e;s("pageData",t.pageData)("textButton","Search"),r(3),s("ngIf",S(4,12,t.paginationService.data$)),r(6),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(4),s("ngIf",S(18,14,t.paginationService.data$)),r(5),I(" Showing 1 - ",S(23,16,(e=S(24,18,t.paginationService.data$))==null?null:e.length)," of "),r(3),s("ngIf",t.paginationService.hideCount),r(1),s("ngIf",!t.paginationService.hideCount&&S(27,20,t.allDataCount$)),r(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),r(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}var it=(()=>{let o=class o{constructor(e,n,a,u,C,f){this.http=e,this.toastr=n,this.dialog=a,this.paginationService=u,this.productService=C,this.authService=f,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(O(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let u=n.map(f=>({ID:f.ID,Code:f.Code,Price:f.UnitPrice}));var a=this.channelOptions.filter(f=>f.selected).map(f=>f.ID);let C={ListChannelID:a,ListPrice:u};this.http.post("/api/Price/UpdateChannel",C).subscribe(f=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+C.ListPrice.length+" items in "+C.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(a=>{let u=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+u.Name+" to "+n.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>a!==void 0)).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(q),b(Z),b(G))},o.\u0275cmp=D({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,ft,32,22,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[R,se,pe,M,F,J,ve,B,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function xt(i,o){if(i&1&&(l(0,"mat-radio-button",3),m(1),c()),i&2){let t=o.$implicit,e=o.index,n=p();s("value",t.Key)("name",n.name)("title",n.tooltipsText[e]?n.tooltipsText[e]:""),r(1),I(" ",t.Value,"")}}var vt=i=>({"border-0 rounded":i}),Pe=(()=>{let o=class o{constructor(){this.modelChange=new De,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Ee],decls:3,vars:5,consts:[[1,"form-control","h-100","rounded-1",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,a){n&1&&(l(0,"div",0)(1,"mat-radio-group",1),h("ngModelChange",function(C){return a.change(C)}),d(2,xt,2,4,"mat-radio-button",2),c()()),n&2&&(s("ngClass",T(3,vt,a.border==!1)),r(1),s("ngModel",a.model),r(1),s("ngForOf",a.options))},dependencies:[A,$,L,He,Ke,Ge,me,M,F],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=o;return i})();function wt(i,o){if(i&1){let t=x();y(0),l(1,"div")(2,"label",23),m(3,"Filter by"),c(),l(4,"radio-options",24),h("modelChange",function(n){_(t);let a=p();return g(a.filterType=n)}),c()(),w()}if(i&2){let t=p();r(4),s("model",t.filterType)("options",t.filterTypeOptions)("border",!0)}}function Tt(i,o){if(i&1){let t=x();l(0,"button",27),h("click",function(){_(t);let n=p().ngIf,a=p();return g(a.onUpdateItems(n))}),P(1,"i",28),m(2," Update "),c()}}function Vt(i,o){if(i&1&&(y(0),l(1,"div",25),d(2,Tt,3,0,"button",26),c(),w()),i&2){let t=o.ngIf,e=p();r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Dt(i,o){if(i&1&&(l(0,"th",29)(1,"div",30),P(2,"img",31),l(3,"div",32),m(4),v(5,"stringLimit"),c()()()),i&2){let t=o.$implicit;r(1),s("matTooltip",(t.Name==null?null:t.Name.length)>20?t.Name:""),r(1),s("src",t==null?null:t.Img,V),r(2),oe("",re(5,4,t.Name,20),"",(t.Name==null?null:t.Name.length)>20?"...":"","")}}function Et(i,o){if(i&1){let t=x();l(0,"th")(1,"input",33),h("ngModelChange",function(n){_(t);let a=p();return g(a.checkboxState=n)})("ngModelChange",function(){_(t);let n=p();return g(n.onSelectAllData())}),c()()}if(i&2){let t=p();r(1),s("ngModel",t.checkboxState)}}function Mt(i,o){i&1&&(y(0),l(1,"th",34)(2,"span"),m(3,"Expected"),c(),l(4,"span",35),m(5,"(POS)"),c()(),l(6,"th",34),m(7," Channel "),c(),w())}function Ft(i,o){if(i&1){let t=x();l(0,"img",48),h("click",function(n){_(t);let a=p(3).$implicit,u=p(2);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c()}if(i&2){let t=p(3).$implicit;ae("src",t==null?null:t.ImageUrl,V)}}function Nt(i,o){i&1&&P(0,"img",49)}var kt=i=>({"border-bottom":i});function Ot(i,o){if(i&1&&(y(0),l(1,"td",42),d(2,Ft,1,1,"img",43)(3,Nt,1,0,"ng-template",null,44,W),c(),l(5,"td",45)(6,"h5",46),m(7),c(),l(8,"small",47),m(9),c()(),w()),i&2){let t=Q(4),e=p().index,n=p().$implicit,a=p().ngIf;r(1),s("rowSpan",n==null?null:n.Variants.length)("ngClass",T(7,kt,e+1==a.length)),r(1),s("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),s("rowSpan",n==null?null:n.Variants.length),r(2),E(n==null?null:n.Name),r(2),I("(",n==null?null:n.Category,")")}}function $t(i,o){if(i&1){let t=x();l(0,"td",50)(1,"input",33),h("ngModelChange",function(n){_(t);let a=p().$implicit;return g(a.selected=n)}),c()()}if(i&2){let t=p().$implicit;r(1),s("ngModel",t.selected)}}var Lt=i=>({"bg-gradient-warning":i});function Rt(i,o){if(i&1){let t=x();y(0),l(1,"td",53),m(2),v(3,"number"),c(),l(4,"td",54),h("click",function(){let a=_(t).$implicit,u=p(2).$implicit,C=p().$implicit,f=p(2);return g(f.openTableDialog(u,C,a))}),l(5,"div",55)(6,"div",56),m(7),v(8,"number"),c(),l(9,"a",57),h("click",function(n){return n==null?null:n.stopPropagation()}),P(10,"i",41),c()()(),w()}if(i&2){let t=o.$implicit;r(2),I(" ",S(3,4,t.PriceExpected)," "),r(2),s("ngClass",T(8,Lt,t.Price!=t.PriceExpected)),r(3),I(" ",S(8,6,t.Price)," "),r(2),s("href",t.Url,V)}}function Bt(i,o){i&1&&(l(0,"td",58),m(1,"X"),c(),l(2,"td",58),m(3,"X"),c())}function Ut(i,o){if(i&1&&(y(0),d(1,Rt,11,10,"ng-container",51)(2,Bt,4,0,"ng-template",null,52,W),w()),i&2){let t=o.$implicit,e=Q(3),n=p().$implicit,a=p(3);r(1),s("ngIf",a.getItemFromChannel(n,t.ID))("ngIfElse",e)}}var At=i=>({"text-decoration-line-through":i}),at=i=>[i];function jt(i,o){if(i&1&&(l(0,"tr"),d(1,Ot,10,9,"ng-container",1),l(2,"td",36),m(3),c(),l(4,"td",37)(5,"div",38)(6,"div",39),m(7),c(),l(8,"div",32)(9,"a",40),P(10,"i",41),c()()()(),d(11,$t,2,1,"ng-template",14)(12,Ut,4,2,"ng-container",15),c()),i&2){let t=o.$implicit,e=o.index,n=p(3);r(1),s("ngIf",e==0),r(2),E(t==null?null:t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(2),s("ngClass",T(8,At,t.isDiscontinued)),r(1),I(" ",t==null?null:t.Code,""),r(2),s("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V),r(2),s("ngxPermissionsOnly",T(10,at,n.rolePriceEdit)),r(1),s("ngForOf",n.channelOptions)}}function zt(i,o){if(i&1&&(l(0,"tbody"),d(1,jt,13,12,"tr",15),c()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Kt(i,o){if(i&1&&(y(0),d(1,zt,2,1,"tbody",15),w()),i&2){let t=o.ngIf;r(1),s("ngForOf",t)}}function Gt(i,o){if(i&1){let t=x();l(0,"span",59),h("click",function(){_(t);let n=p();return g(n.getRowCount())}),l(1,"i",60),m(2,"?"),c()()}}function Ht(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t))}}function Jt(i,o){if(i&1){let t=x();l(0,"a",61),h("click",function(){_(t);let n=p();return g(n.onNextPage())}),P(1,"i",62),m(2," Next"),c()}}function Zt(i,o){if(i&1){let t=x();l(0,"a",63),h("click",function(){_(t);let n=p();return g(n.onLastPage())}),P(1,"i",64),m(2," Last"),c()}}var ot=(()=>{let o=class o{constructor(e,n,a,u,C,f,be){this.http=e,this.toastr=n,this.dialog=a,this.productService=u,this.authService=C,this.biggerPictureService=f,this.paginationService=be,this.searchFilter=new ze,this.checkboxState=!1,this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:N.ALL,Value:"All"},{Key:N.DIFFERENCE,Value:"Difference"}],this.filterType=N.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.paginationService.fetchDataEndpoint="Price/GetOutletPrice",this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.paginationService.data$.pipe(Y(e=>(e=e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=a.Discontinued=="Yes",a))),n)),e)),te(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(O(e=>{this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{}).pipe(O(e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}))}getRowCount(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{})}onSelectAllData(){this.data$=this.data$.pipe(Y(e=>(e.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a))),n)),e)))}onFilter(e){let n={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.paginationService.reloadPagination(n)}updatePrice(e){let n=this.productService.selectedVariantProduct(e);if(n.length>0){let a=n.map(f=>f.ID),C={ListChannelID:this.channelOptions.filter(f=>f.selected).map(f=>f.ID),ListID:a};this.http.post("/api/Price/UpdateChannelOutletPrice",C).subscribe({next:f=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+C.ListID.length+" items in "+C.ListChannelID.length+" channels","Success")},error:f=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,n){return e.Channel.find(a=>a.ChannelID==n)}onUpdateItems(e){let n=this.productService.selectedVariantProduct(e);this.dialog.open(Ce,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(k(a=>z.IsNotEmpty(a))).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateProductPrice(f,a)})}updateProductPrice(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{n.Price=a.Price;let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success")})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(K),b(H),b(Z),b(G),b(he),b(q))},o.\u0275cmp=D({type:o,selectors:[["app-custom-channel-price"]],decls:42,vars:30,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2","class","w-100","class","text-center border-bottom-0 border text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"fw-bold","mb-2"],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){if(n&1&&(l(0,"mainpanel",0),h("onSubmit",function(C){return a.onFilter(C)}),l(1,"filters"),d(2,wt,5,3,"ng-container",1),v(3,"async"),c(),l(4,"actions"),d(5,Vt,3,1,"ng-container",1),v(6,"async"),c(),l(7,"content")(8,"div",2)(9,"div",3)(10,"div",4)(11,"div",5)(12,"table",6)(13,"thead",7)(14,"tr",8),P(15,"th",9),d(16,Dt,6,7,"th",10),c(),l(17,"tr")(18,"th",11)(19,"span"),m(20," Product "),c()(),l(21,"th",12),m(22,"Variant"),c(),l(23,"th",13),m(24,"SKU"),c(),d(25,Et,2,1,"ng-template",14)(26,Mt,8,0,"ng-container",15),c()(),d(27,Kt,2,1,"ng-container",1),v(28,"async"),c()()()(),l(29,"div",16)(30,"div",17)(31,"div",18),m(32),v(33,"number"),v(34,"async"),d(35,Gt,3,0,"span",19)(36,Ht,3,3,"span",1),v(37,"async"),m(38),c()(),l(39,"div",20),d(40,Jt,3,0,"a",21)(41,Zt,3,0,"a",22),c()()()()()),n&2){let u;s("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",S(3,16,a.loader$)),r(3),s("ngIf",S(6,18,a.data$)),r(11),s("ngForOf",a.channelOptions),r(9),s("ngxPermissionsOnly",T(28,at,a.rolePriceEdit)),r(1),s("ngForOf",a.channelOptions),r(1),s("ngIf",S(28,20,a.data$)),r(5),I(" Showing 1 - ",S(33,22,(u=S(34,24,a.paginationService.data$))==null?null:u.length)," of "),r(3),s("ngIf",a.paginationService.hideCount),r(1),s("ngIf",!a.paginationService.hideCount&&S(37,26,a.totalData$)),r(2),I(" records ~ ",a.paginationService.footerPageNumber," Page "),r(2),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage),r(1),s("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage)}},dependencies:[$,L,R,ce,M,F,J,ue,Pe,_e,B,U,xe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let i=o;return i})();function qt(i,o){if(i&1&&(l(0,"span",9),P(1,"img",10),c(),m(2)),i&2){let t=o.item;r(1),s("src",t==null?null:t.Img,V),r(1),I(" ",t.Name," ")}}function Xt(i,o){if(i&1){let t=x();l(0,"button",13),h("click",function(){_(t);let n=p().ngIf,a=p(2);return g(a.updateStock(n))}),P(1,"i",14),m(2," Update "),c()}}function Yt(i,o){if(i&1&&(l(0,"actions")(1,"div",11),d(2,Xt,3,0,"button",12),c()()),i&2){let t=o.ngIf,e=p(2);r(2),s("ngIf",e.productService.hasSelectionVariant(t))}}function Qt(i,o){if(i&1){let t=x();l(0,"th")(1,"input",34),h("change",function(n){_(t);let a=p().ngIf,u=p(2);return g(u.onSelectAllSKU(n.target.checked,a))}),c()()}}function Wt(i,o){if(i&1){let t=x();l(0,"input",52),h("ngModelChange",function(n){_(t);let a=p(4).$implicit;return g(a.selected=n)})("ngModelChange",function(){_(t);let n=p(4).$implicit,a=p(3);return g(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=p(4).$implicit;s("ngModel",t.selected)}}var Te=i=>[i];function en(i,o){if(i&1&&(y(0),d(1,Wt,1,1,"ng-template",23),w()),i&2){let t=p(6);r(1),s("ngxPermissionsOnly",T(1,Te,t.rolePriceEdit))}}function tn(i,o){if(i&1){let t=x();y(0),l(1,"img",53),h("click",function(n){_(t);let a=p(3).$implicit,u=p(3);return g(u.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),w()}if(i&2){let t=p(3).$implicit;r(1),ae("src",t.ThumbnailUrl,V)}}function nn(i,o){i&1&&P(0,"img",54)}function an(i,o){if(i&1&&(y(0),P(1,"br"),l(2,"small"),m(3),c(),w()),i&2){let t=p(3).$implicit;r(3),I("(",t.Category,")")}}var on=i=>({"ms-10":i});function rn(i,o){if(i&1&&(y(0),l(1,"td",46)(2,"div",47),d(3,en,2,3,"ng-container",8),l(4,"div",36),d(5,tn,2,1,"ng-container",48)(6,nn,1,0,"ng-template",null,49,W),c()()(),l(8,"td",50)(9,"span",51),m(10),c(),d(11,an,4,1,"ng-container",8),c(),w()),i&2){let t=Q(7),e=p(2).$implicit,n=p(3);r(1),s("rowSpan",e.Variants.length),r(2),s("ngIf",(e.Variants==null?null:e.Variants.length)>1),r(1),s("ngClass",T(8,on,(e.Variants==null?null:e.Variants.length)<=1)),r(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",t),r(3),s("rowSpan",e.Variants.length),r(2),E(e.Name),r(1),s("ngIf",(e==null?null:e.CategoryID)!==null&&(e==null?null:e.CategoryID)!=n.guidEmpty)}}function ln(i,o){if(i&1){let t=x();l(0,"input",57),h("ngModelChange",function(n){_(t);let a=p(2).$implicit;return g(a.selected=n)}),c()}if(i&2){let t=p(2).$implicit;s("ngModel",t.selected)}}function cn(i,o){if(i&1&&(l(0,"td",55),d(1,ln,1,1,"input",56),c()),i&2){let t=p().$implicit;r(1),s("ngIf",t.Inventory>=0)}}function sn(i,o){i&1&&(l(0,"div",58),m(1,"Not Found"),c())}function pn(i,o){if(i&1&&(l(0,"div"),m(1),v(2,"number"),c()),i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.UnitPrice),"")}}function mn(i,o){if(i&1&&(y(0),l(1,"div",41)(2,"a",42),P(3,"i",59),c()(),w()),i&2){let t=p().$implicit,e=p(4);r(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function dn(i,o){if(i&1){let t=x();l(0,"div",60),h("click",function(){_(t);let n=p().$implicit,a=p().$implicit,u=p(2).ngIf,C=p();return g(C.openTableDialog(n,a,u))}),m(1),v(2,"number"),c()}if(i&2){let t=p().$implicit;r(1),I(" ",S(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}var _n=i=>({"text-decoration-line-through":i}),gn=i=>({"bg-gradient-warning":i});function un(i,o){if(i&1){let t=x();l(0,"tr"),d(1,rn,12,10,"ng-container",8),l(2,"td",21),m(3),c(),l(4,"td",35)(5,"span",36),m(6),c()(),d(7,cn,2,1,"ng-template",23),l(8,"td",24)(9,"div",37),d(10,sn,2,0,"div",38)(11,pn,3,3,"div",8)(12,mn,4,1,"ng-container",8),c()(),l(13,"td",39)(14,"div",37),d(15,dn,3,3,"div",40),l(16,"div",41)(17,"a",42),P(18,"i",43),c()(),l(19,"div",41)(20,"div",44),h("click",function(){let a=_(t).$implicit,u=p(4);return g(u.refreshPrice(a))}),P(21,"i",45),c()()()()()}if(i&2){let t=o.$implicit,e=o.index,n=p(4);r(1),s("ngIf",e==0),r(2),E(t.Model),r(1),s("matTooltip",t.isDiscontinued?n.discontinuedVariantMsg:""),r(1),s("ngClass",T(12,_n,t.isDiscontinued)),r(1),I(" ",t.Code," "),r(1),s("ngxPermissionsOnly",T(14,Te,n.rolePriceEdit)),r(3),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)!=null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngIf",(t.Channel[0]==null?null:t.Channel[0].Description)==null),r(1),s("ngClass",T(16,gn,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),r(2),s("ngIf",t.Channel.length>0),r(2),s("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function hn(i,o){if(i&1&&(y(0),d(1,un,22,18,"tr",28),w()),i&2){let t=o.$implicit;r(1),s("ngForOf",t.Variants)}}function Cn(i,o){if(i&1){let t=x();l(0,"span",60),h("click",function(){_(t);let n=p(3);return g(n.getRowCount())}),l(1,"i",61),m(2,"?"),c()()}}function fn(i,o){if(i&1&&(l(0,"span"),m(1),v(2,"number"),c()),i&2){let t=o.ngIf;r(1),E(S(2,1,t.Total))}}function xn(i,o){if(i&1){let t=x();l(0,"a",65),h("click",function(){_(t);let n=p(4);return g(n.onNextPage())}),P(1,"i",66),m(2," Next"),c()}}function vn(i,o){if(i&1){let t=x();l(0,"a",67),h("click",function(){_(t);let n=p(4);return g(n.onLastPage())}),P(1,"i",68),m(2," Last"),c()}}function Sn(i,o){if(i&1&&(l(0,"div",62),d(1,xn,3,0,"a",63)(2,vn,3,0,"a",64),c()),i&2){let t=p(3);r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),r(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Pn(i,o){if(i&1){let t=x();l(0,"content")(1,"div",15)(2,"div",16)(3,"table",17)(4,"thead",18)(5,"tr")(6,"th",19),m(7," Product "),l(8,"div")(9,"mat-slide-toggle",20),h("ngModelChange",function(n){_(t);let a=p(2);return g(a.toggleDifferentInventory=n)})("toggleChange",function(){_(t);let n=p(2);return g(n.onToggleDifferentInventory())}),l(10,"small",6),m(11,"FILTER DIFFERENT PRICE"),c()()()(),l(12,"th",21),m(13,"Variant"),c(),l(14,"th",22),m(15,"SKU"),c(),d(16,Qt,2,0,"ng-template",23),l(17,"th",24),m(18,"POS"),c(),l(19,"th",24)(20,"div",25),h("click",function(){_(t);let n=p(2);return g(n.openModalFilter())}),P(21,"img",26),l(22,"span",27),m(23),v(24,"stringLimit"),c()()()()(),l(25,"tbody"),d(26,hn,2,1,"ng-container",28),c()(),l(27,"div",29)(28,"div",30)(29,"div",31),m(30),v(31,"number"),d(32,Cn,3,0,"span",32)(33,fn,3,3,"span",8),v(34,"async"),m(35),c()(),d(36,Sn,3,2,"div",33),c()()()()}if(i&2){let t=o.ngIf,e=p(2);r(9),s("ngModel",e.toggleDifferentInventory),r(7),s("ngxPermissionsOnly",T(19,Te,e.rolePriceEdit)),r(4),s("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),s("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),r(2),oe(" ",re(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),r(3),s("ngForOf",t),r(4),I(" Showing 1 - ",S(31,15,t==null?null:t.length)," of "),r(2),s("ngIf",e.paginationService.hideCount),r(1),s("ngIf",S(34,17,!e.paginationService.hideCount&&e.allDataCount$)),r(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),s("ngIf",t.length>0)}}function bn(i,o){if(i&1){let t=x();l(0,"mainpanel",1),h("textChange",function(n){_(t);let a=p();return g(a.searchFilter.text=n)})("onSubmit",function(){_(t);let n=p();return g(n.onSearch())}),l(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),c(),l(5,"ng-select",3),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.ChannelID=n)}),d(6,qt,3,2,"ng-template",4),c()(),l(7,"div",5)(8,"label",6),m(9,"Page Number"),c(),l(10,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.PageNumber=n)}),c()(),l(11,"div",5)(12,"label",6),m(13,"Page Size"),c(),l(14,"input",7),h("ngModelChange",function(n){_(t);let a=p();return g(a.searchFilter.RowCount=n)}),c()()(),d(15,Yt,3,1,"actions",8),v(16,"async"),d(17,Pn,37,21,"content",8),v(18,"async"),c()}if(i&2){let t=p();s("headerTitle",t.pageTitle)("text",t.searchFilter.text),r(5),s("clearable",!1)("items",t.channelOptions)("ngModel",t.searchFilter.ChannelID),r(5),s("ngModel",t.searchFilter.PageNumber),r(4),s("ngModel",t.searchFilter.RowCount),r(1),s("ngIf",S(16,9,t.data$)),r(2),s("ngIf",S(18,11,t.data$))}}var rt=(()=>{let o=class o{constructor(e,n,a,u,C,f,be,Ve,st){this.http=e,this.paginationService=n,this.toastr=a,this.dialog=u,this.productService=C,this.biggerPictureService=f,this.inventoryService=be,this.authService=Ve,this.mainPanelService=st,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=de.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=z.GuidEMpty,this.hostName=this.authService.getDomain(),this.data$=this.paginationService.data$.pipe(te(1),Y(pt=>pt.map(ee=>(ee.Variants&&(ee.Variants=ee.Variants.map(Ie=>(Ie.isDiscontinued=Ie.Discontinued=="Yes",Ie))),ee)))),this.channelOptions=Ve.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(O(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=N.ALL,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),u={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",u).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,n,a){let u=JSON.parse(JSON.stringify(e));this.dialog.open(fe,{data:{Name:n.Name,Variant:u,ChannelID:u?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:u?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(k(f=>z.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(u=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(u=>(u.selected=e,u)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(b(j),b(q),b(K),b(H),b(Z),b(he),b(Se),b(G),b(Be))},o.\u0275cmp=D({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"ms-1"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(d(0,bn,19,13,"mainpanel",0),v(1,"async")),n&2&&s("ngIf",S(1,1,a.loader$))},dependencies:[$,L,R,se,pe,ce,M,F,J,$e,ke,Oe,Ze,ue,_e,B,U,xe],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=o;return i})();var lt=(()=>{let o=class o{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),P(3,"nav-tab",2),c()()(),P(4,"router-outlet")),n&2&&(r(3),s("Tabs",a.priceTabs))},dependencies:[Ae,Me]});let i=o;return i})();var In=[{path:"",component:lt,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:it,canActivate:[ge],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:ot,canActivate:[ge],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:rt,canActivate:[ge],data:{title:"Price Single Channel Comparison"}}]}],ct=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({imports:[A,le.forChild(In)]});let i=o;return i})();var $i=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=ie({type:o}),o.\u0275inj=ne({providers:[Se],imports:[A,me,je,Ue,le,Le,ct,Fe,qe,Je,Re,Pe,ve,Ne.forChild()]});let i=o;return i})();export{$i as PriceModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as D,b as ee,j as Cd,k as Oo,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.
|
|
1
|
+
import{a as D,b as ee,j as Cd,k as Oo,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.1/Marketplace/chunk-PUBPICPK.js";function M(t){return typeof t=="function"}function da(t){return M(t?.lift)}function b(t){return e=>{if(da(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function jt(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Po=jt(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
2
2
|
${r.map((n,o)=>`${o+1}) ${n.toString()}`).join(`
|
|
3
3
|
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function tn(t,e){if(t){let r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Q=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let i of r)i.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(M(n))try{n()}catch(i){e=i instanceof Po?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{bd(i)}catch(s){e=e??[],s instanceof Po?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Po(e)}}add(e){var r;if(e&&e!==this)if(this.closed)bd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&tn(r,e)}remove(e){let{_finalizers:r}=this;r&&tn(r,e),e instanceof t&&e._removeParent(this)}};Q.EMPTY=(()=>{let t=new Q;return t.closed=!0,t})();var fa=Q.EMPTY;function Fo(t){return t instanceof Q||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function bd(t){M(t)?t():t.unsubscribe()}var Be={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Tn={setTimeout(t,e,...r){let{delegate:n}=Tn;return n?.setTimeout?n.setTimeout(t,e,...r):setTimeout(t,e,...r)},clearTimeout(t){let{delegate:e}=Tn;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function ko(t){Tn.setTimeout(()=>{let{onUnhandledError:e}=Be;if(e)e(t);else throw t})}function He(){}var Md=(()=>ha("C",void 0,void 0))();function Sd(t){return ha("E",void 0,t)}function Td(t){return ha("N",t,void 0)}function ha(t,e,r){return{kind:t,value:e,error:r}}var nn=null;function xn(t){if(Be.useDeprecatedSynchronousErrorHandling){let e=!nn;if(e&&(nn={errorThrown:!1,error:null}),t(),e){let{errorThrown:r,error:n}=nn;if(nn=null,r)throw n}}else t()}function xd(t){Be.useDeprecatedSynchronousErrorHandling&&nn&&(nn.errorThrown=!0,nn.error=t)}var rn=class extends Q{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Fo(e)&&e.add(this)):this.destination=Dv}static create(e,r,n){return new yt(e,r,n)}next(e){this.isStopped?ga(Td(e),this):this._next(e)}error(e){this.isStopped?ga(Sd(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?ga(Md,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},vv=Function.prototype.bind;function pa(t,e){return vv.call(t,e)}var ma=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(n){Lo(n)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(n){Lo(n)}else Lo(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){Lo(r)}}},yt=class extends rn{constructor(e,r,n){super();let o;if(M(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&Be.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&pa(e.next,i),error:e.error&&pa(e.error,i),complete:e.complete&&pa(e.complete,i)}):o=e}this.destination=new ma(o)}};function Lo(t){Be.useDeprecatedSynchronousErrorHandling?xd(t):ko(t)}function yv(t){throw t}function ga(t,e){let{onStoppedNotification:r}=Be;r&&Tn.setTimeout(()=>r(t,e))}var Dv={closed:!0,next:He,error:yv,complete:He};function I(t,e,r,n,o){return new va(t,e,r,n,o)}var va=class extends rn{constructor(e,r,n,o,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=r?function(a){try{r(a)}catch(u){e.error(u)}}:super._next,this._error=o?function(a){try{o(a)}catch(u){e.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function O(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{n.next(t.call(e,i,o++))}))})}var _n=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function le(t){return t}function ya(...t){return Da(t)}function Da(t){return t.length===0?le:t.length===1?t[0]:function(r){return t.reduce((n,o)=>o(n),r)}}var k=(()=>{class t{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new t;return n.source=this,n.operator=r,n}subscribe(r,n,o){let i=Cv(r)?r:new yt(r,n,o);return xn(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=_d(n),new n((o,i)=>{let s=new yt({next:a=>{try{r(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[_n](){return this}pipe(...r){return Da(r)(this)}toPromise(r){return r=_d(r),new r((n,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>n(i))})}}return t.create=e=>new t(e),t})();function _d(t){var e;return(e=t??Be.Promise)!==null&&e!==void 0?e:Promise}function wv(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}function Cv(t){return t&&t instanceof rn||wv(t)&&Fo(t)}var Ad=jt(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var ae=(()=>{class t extends k{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new jo(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new Ad}next(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:o,observers:i}=this;return n||o?fa:(this.currentObservers=null,i.push(r),new Q(()=>{this.currentObservers=null,tn(i,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:o,isStopped:i}=this;n?r.error(o):i&&r.complete()}asObservable(){let r=new k;return r.source=this,r}}return t.create=(e,r)=>new jo(e,r),t})(),jo=class extends ae{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)}error(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:fa}};var Ir={now(){return(Ir.delegate||Date).now()},delegate:void 0};var br=class extends ae{constructor(e=1/0,r=1/0,n=Ir){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;r||(n.push(e),!o&&n.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!e.closed;s+=n?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:o}=this,i=(o?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!o){let s=r.now(),a=0;for(let u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}}};var An=t=>t&&typeof t.length=="number"&&typeof t!="function";function Vo(t){return M(t?.then)}function $o(t){return M(t[_n])}function Uo(t){return Symbol.asyncIterator&&M(t?.[Symbol.asyncIterator])}function Bo(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Ev(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ho=Ev();function zo(t){return M(t?.[Ho])}function Wo(t){return Ed(this,arguments,function*(){let r=t.getReader();try{for(;;){let{value:n,done:o}=yield Oo(r.read());if(o)return yield Oo(void 0);yield yield Oo(n)}}finally{r.releaseLock()}})}function Go(t){return M(t?.getReader)}function P(t){if(t instanceof k)return t;if(t!=null){if($o(t))return Iv(t);if(An(t))return bv(t);if(Vo(t))return Mv(t);if(Uo(t))return Nd(t);if(zo(t))return Sv(t);if(Go(t))return Tv(t)}throw Bo(t)}function Iv(t){return new k(e=>{let r=t[_n]();if(M(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function bv(t){return new k(e=>{for(let r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Mv(t){return new k(e=>{t.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,ko)})}function Sv(t){return new k(e=>{for(let r of t)if(e.next(r),e.closed)return;e.complete()})}function Nd(t){return new k(e=>{xv(t,e).catch(r=>e.error(r))})}function Tv(t){return Nd(Wo(t))}function xv(t,e){var r,n,o,i;return Cd(this,void 0,void 0,function*(){try{for(r=Id(t);n=yield r.next(),!n.done;){let s=n.value;if(e.next(s),e.closed)return}}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(o)throw o.error}}e.complete()})}function Ca(t={}){let{connector:e=()=>new ae,resetOnError:r=!0,resetOnComplete:n=!0,resetOnRefCountZero:o=!0}=t;return i=>{let s,a,u,c=0,l=!1,d=!1,f=()=>{a?.unsubscribe(),a=void 0},h=()=>{f(),s=u=void 0,l=d=!1},p=()=>{let S=s;h(),S?.unsubscribe()};return b((S,C)=>{c++,!d&&!l&&f();let m=u=u??e();C.add(()=>{c--,c===0&&!d&&!l&&(a=wa(p,o))}),m.subscribe(C),!s&&c>0&&(s=new yt({next:j=>m.next(j),error:j=>{d=!0,f(),a=wa(h,r,j),m.error(j)},complete:()=>{l=!0,f(),a=wa(h,n),m.complete()}}),P(S).subscribe(s))})(i)}}function wa(t,e,...r){if(e===!0){t();return}if(e===!1)return;let n=new yt({next:()=>{n.unsubscribe(),t()}});return P(e(...r)).subscribe(n)}function Rd(t,e,r){let n,o=!1;return t&&typeof t=="object"?{bufferSize:n=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:r}=t:n=t??1/0,Ca({connector:()=>new br(n,e,r),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Nn(){return b((t,e)=>{let r=null;t._refCount++;let n=I(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){r=null;return}let o=t._connection,i=r;r=null,o&&(!i||o===i)&&o.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}var Rn=class extends k{constructor(e,r){super(),this.source=e,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,da(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Q;let r=this.getSubject();e.add(this.source.subscribe(I(r,void 0,()=>{this._teardown(),r.complete()},n=>{this._teardown(),r.error(n)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Q.EMPTY)}return e}refCount(){return Nn()(this)}};var On={schedule(t){let e=requestAnimationFrame,r=cancelAnimationFrame,{delegate:n}=On;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);let o=e(i=>{r=void 0,t(i)});return new Q(()=>r?.(o))},requestAnimationFrame(...t){let{delegate:e}=On;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=On;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var de=class extends ae{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:n}=this;if(e)throw r;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}};var qo=class extends Q{constructor(e,r){super()}schedule(e,r=0){return this}};var Mr={setInterval(t,e,...r){let{delegate:n}=Mr;return n?.setInterval?n.setInterval(t,e,...r):setInterval(t,e,...r)},clearInterval(t){let{delegate:e}=Mr;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Ke=class extends qo{constructor(e,r){super(e,r),this.scheduler=e,this.work=r,this.pending=!1}schedule(e,r=0){var n;if(this.closed)return this;this.state=e;let o=this.id,i=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(i,o,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(i,this.id,r),this}requestAsyncId(e,r,n=0){return Mr.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&Mr.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(e,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let n=!1,o;try{this.work(e)}catch(i){n=!0,o=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,tn(n,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var _v=1,Ea,Ia={};function Od(t){return t in Ia?(delete Ia[t],!0):!1}var Pd={setImmediate(t){let e=_v++;return Ia[e]=!0,Ea||(Ea=Promise.resolve()),Ea.then(()=>Od(e)&&t()),e},clearImmediate(t){Od(t)}};var{setImmediate:Av,clearImmediate:Nv}=Pd,Sr={setImmediate(...t){let{delegate:e}=Sr;return(e?.setImmediate||Av)(...t)},clearImmediate(t){let{delegate:e}=Sr;return(e?.clearImmediate||Nv)(t)},delegate:void 0};var Zo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=Sr.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(Sr.clearImmediate(r),e._scheduled===r&&(e._scheduled=void 0))}};var Pn=class t{constructor(e,r=t.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,n){return new this.schedulerActionCtor(this,e).schedule(n,r)}};Pn.now=Ir.now;var Je=class extends Pn{constructor(e,r=Pn.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,n){for(;e=r.shift();)e.unsubscribe();throw n}}};var Yo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Rv=new Yo(Zo);var Xe=new Je(Ke),ba=Xe;var Qo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}schedule(e,r=0){return r>0?super.schedule(e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)}execute(e,r){return r>0||this.closed?super.execute(e,r):this._execute(e,r)}requestAsyncId(e,r,n=0){return n!=null&&n>0||n==null&&this.delay>0?super.requestAsyncId(e,r,n):(e.flush(this),0)}};var Ko=class extends Je{};var Ov=new Ko(Qo);var Jo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=On.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(On.cancelAnimationFrame(r),e._scheduled=void 0)}};var Xo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Pv=new Xo(Jo);var Ie=new k(t=>t.complete());function ei(t){return t&&M(t.schedule)}function Ma(t){return t[t.length-1]}function Fn(t){return M(Ma(t))?t.pop():void 0}function et(t){return ei(Ma(t))?t.pop():void 0}function Fd(t,e){return typeof Ma(t)=="number"?t.pop():e}function pe(t,e,r,n=0,o=!1){let i=e.schedule(function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!o)return i}function Tr(t,e=0){return b((r,n)=>{r.subscribe(I(n,o=>pe(n,t,()=>n.next(o),e),()=>pe(n,t,()=>n.complete(),e),o=>pe(n,t,()=>n.error(o),e)))})}function xr(t,e=0){return b((r,n)=>{n.add(t.schedule(()=>r.subscribe(n),e))})}function kd(t,e){return P(t).pipe(xr(e),Tr(e))}function Ld(t,e){return P(t).pipe(xr(e),Tr(e))}function jd(t,e){return new k(r=>{let n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function Vd(t,e){return new k(r=>{let n;return pe(r,e,()=>{n=t[Ho](),pe(r,e,()=>{let o,i;try{({value:o,done:i}=n.next())}catch(s){r.error(s);return}i?r.complete():r.next(o)},0,!0)}),()=>M(n?.return)&&n.return()})}function ti(t,e){if(!t)throw new Error("Iterable cannot be null");return new k(r=>{pe(r,e,()=>{let n=t[Symbol.asyncIterator]();pe(r,e,()=>{n.next().then(o=>{o.done?r.complete():r.next(o.value)})},0,!0)})})}function $d(t,e){return ti(Wo(t),e)}function Ud(t,e){if(t!=null){if($o(t))return kd(t,e);if(An(t))return jd(t,e);if(Vo(t))return Ld(t,e);if(Uo(t))return ti(t,e);if(zo(t))return Vd(t,e);if(Go(t))return $d(t,e)}throw Bo(t)}function G(t,e){return e?Ud(t,e):P(t)}function x(...t){let e=et(t);return G(t,e)}function kn(t,e){let r=M(t)?t:()=>t,n=o=>o.error(r());return new k(e?o=>e.schedule(n,0,o):n)}function Sa(t){return!!t&&(t instanceof k||M(t.lift)&&M(t.subscribe))}var Dt=jt(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function ni(t){return t instanceof Date&&!isNaN(t)}var Fv=jt(t=>function(r=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function kv(t,e){let{first:r,each:n,with:o=Lv,scheduler:i=e??Xe,meta:s=null}=ni(t)?{first:t}:typeof t=="number"?{each:t}:t;if(r==null&&n==null)throw new TypeError("No timeout provided.");return b((a,u)=>{let c,l,d=null,f=0,h=p=>{l=pe(u,i,()=>{try{c.unsubscribe(),P(o({meta:s,lastValue:d,seen:f})).subscribe(u)}catch(S){u.error(S)}},p)};c=a.subscribe(I(u,p=>{l?.unsubscribe(),f++,u.next(d=p),n>0&&h(n)},void 0,void 0,()=>{l?.closed||l?.unsubscribe(),d=null})),!f&&h(r!=null?typeof r=="number"?r:+r-i.now():n)})}function Lv(t){throw new Fv(t)}var{isArray:jv}=Array;function Vv(t,e){return jv(e)?t(...e):t(e)}function Ln(t){return O(e=>Vv(t,e))}var{isArray:$v}=Array,{getPrototypeOf:Uv,prototype:Bv,keys:Hv}=Object;function ri(t){if(t.length===1){let e=t[0];if($v(e))return{args:e,keys:null};if(zv(e)){let r=Hv(e);return{args:r.map(n=>e[n]),keys:r}}}return{args:t,keys:null}}function zv(t){return t&&typeof t=="object"&&Uv(t)===Bv}function oi(t,e){return t.reduce((r,n,o)=>(r[n]=e[o],r),{})}function _r(...t){let e=et(t),r=Fn(t),{args:n,keys:o}=ri(t);if(n.length===0)return G([],e);let i=new k(Wv(n,e,o?s=>oi(o,s):le));return r?i.pipe(Ln(r)):i}function Wv(t,e,r=le){return n=>{Bd(e,()=>{let{length:o}=t,i=new Array(o),s=o,a=o;for(let u=0;u<o;u++)Bd(e,()=>{let c=G(t[u],e),l=!1;c.subscribe(I(n,d=>{i[u]=d,l||(l=!0,a--),a||n.next(r(i.slice()))},()=>{--s||n.complete()}))},n)},n)}}function Bd(t,e,r){t?pe(r,t,e):e()}function Hd(t,e,r,n,o,i,s,a){let u=[],c=0,l=0,d=!1,f=()=>{d&&!u.length&&!c&&e.complete()},h=S=>c<n?p(S):u.push(S),p=S=>{i&&e.next(S),c++;let C=!1;P(r(S,l++)).subscribe(I(e,m=>{o?.(m),i?h(m):e.next(m)},()=>{C=!0},void 0,()=>{if(C)try{for(c--;u.length&&c<n;){let m=u.shift();s?pe(e,s,()=>p(m)):p(m)}f()}catch(m){e.error(m)}}))};return t.subscribe(I(e,h,()=>{d=!0,f()})),()=>{a?.()}}function K(t,e,r=1/0){return M(e)?K((n,o)=>O((i,s)=>e(n,i,o,s))(P(t(n,o))),r):(typeof e=="number"&&(r=e),b((n,o)=>Hd(n,o,t,r)))}function tt(t=1/0){return K(le,t)}function zd(){return tt(1)}function jn(...t){return zd()(G(t,et(t)))}function ii(t){return new k(e=>{P(t()).subscribe(e)})}function Gv(...t){let e=Fn(t),{args:r,keys:n}=ri(t),o=new k(i=>{let{length:s}=r;if(!s){i.complete();return}let a=new Array(s),u=s,c=s;for(let l=0;l<s;l++){let d=!1;P(r[l]).subscribe(I(i,f=>{d||(d=!0,c--),a[l]=f},()=>u--,void 0,()=>{(!u||!d)&&(c||i.next(n?oi(n,a):a),i.complete())}))}});return e?o.pipe(Ln(e)):o}var qv=["addListener","removeListener"],Zv=["addEventListener","removeEventListener"],Yv=["on","off"];function Ta(t,e,r,n){if(M(r)&&(n=r,r=void 0),n)return Ta(t,e,r).pipe(Ln(n));let[o,i]=Jv(t)?Zv.map(s=>a=>t[s](e,a,r)):Qv(t)?qv.map(Wd(t,e)):Kv(t)?Yv.map(Wd(t,e)):[];if(!o&&An(t))return K(s=>Ta(s,e,r))(P(t));if(!o)throw new TypeError("Invalid event target");return new k(s=>{let a=(...u)=>s.next(1<u.length?u:u[0]);return o(a),()=>i(a)})}function Wd(t,e){return r=>n=>t[r](e,n)}function Qv(t){return M(t.addListener)&&M(t.removeListener)}function Kv(t){return M(t.on)&&M(t.off)}function Jv(t){return M(t.addEventListener)&&M(t.removeEventListener)}function Ar(t=0,e,r=ba){let n=-1;return e!=null&&(ei(e)?r=e:n=e),new k(o=>{let i=ni(t)?+t-r.now():t;i<0&&(i=0);let s=0;return r.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Xv(t=0,e=Xe){return t<0&&(t=0),Ar(t,t,e)}function ey(...t){let e=et(t),r=Fd(t,1/0),n=t;return n.length?n.length===1?P(n[0]):tt(r)(G(n,e)):Ie}function Gd(t,e){return(r,n)=>!t.call(e,r,n)}function te(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>t.call(e,i,o++)&&n.next(i)))})}function ty(t,e,r){return[te(e,r)(P(t)),te(Gd(e,r))(P(t))]}function qd(t){return b((e,r)=>{let n=!1,o=null,i=null,s=!1,a=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let c=o;o=null,r.next(c)}s&&r.complete()},u=()=>{i=null,s&&r.complete()};e.subscribe(I(r,c=>{n=!0,o=c,i||P(t(c)).subscribe(i=I(r,a,u))},()=>{s=!0,(!n||!i||i.closed)&&r.complete()}))})}function ny(t,e=Xe){return qd(()=>Ar(t,e))}function wt(t){return b((e,r)=>{let n=null,o=!1,i;n=e.subscribe(I(r,void 0,void 0,s=>{i=P(t(s,wt(t)(e))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}function Zd(t,e,r,n,o){return(i,s)=>{let a=r,u=e,c=0;i.subscribe(I(s,l=>{let d=c++;u=a?t(u,l,d):(a=!0,l),n&&s.next(u)},o&&(()=>{a&&s.next(u),s.complete()})))}}function nt(t,e){return M(e)?K(t,e,1):K(t,1)}function ry(t){return b((e,r)=>{let n=!1,o=null,i=null,s=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let a=o;o=null,r.next(a)}};e.subscribe(I(r,a=>{i?.unsubscribe(),n=!0,o=a,i=I(r,s,He),P(t(a)).subscribe(i)},()=>{s(),r.complete()},void 0,()=>{o=i=null}))})}function oy(t,e=Xe){return b((r,n)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let c=i;i=null,n.next(c)}};function u(){let c=s+t,l=e.now();if(l<c){o=this.schedule(void 0,c-l),n.add(o);return}a()}r.subscribe(I(n,c=>{i=c,s=e.now(),o||(o=e.schedule(u,t),n.add(o))},()=>{a(),n.complete()},void 0,()=>{i=o=null}))})}function Vt(t){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>{n||r.next(t),r.complete()}))})}function Ct(t){return t<=0?()=>Ie:b((e,r)=>{let n=0;e.subscribe(I(r,o=>{++n<=t&&(r.next(o),t<=n&&r.complete())}))})}function iy(){return b((t,e)=>{t.subscribe(I(e,He))})}function xa(t){return O(()=>t)}function sy(t,e=le){return t=t??ay,b((r,n)=>{let o,i=!0;r.subscribe(I(n,s=>{let a=e(s);(i||!t(o,a))&&(i=!1,o=a,n.next(s))}))})}function ay(t,e){return t===e}function si(t=uy){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>n?r.complete():r.error(t())))})}function uy(){return new Dt}function cy(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{t.call(e,i,o++,r)||(n.next(!1),n.complete())},()=>{n.next(!0),n.complete()}))})}function $t(t){return b((e,r)=>{try{e.subscribe(r)}finally{r.add(t)}})}function rt(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,Ct(1),r?Vt(e):si(()=>new Dt))}function Vn(t){return t<=0?()=>Ie:b((e,r)=>{let n=[];e.subscribe(I(r,o=>{n.push(o),t<n.length&&n.shift()},()=>{for(let o of n)r.next(o);r.complete()},void 0,()=>{n=null}))})}function _a(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,Vn(1),r?Vt(e):si(()=>new Dt))}function ai(t,e){return b(Zd(t,e,arguments.length>=2,!0))}function ly(t){return te((e,r)=>t<=r)}function Aa(...t){let e=et(t);return b((r,n)=>{(e?jn(t,r,e):jn(t,r)).subscribe(n)})}function ue(t,e){return b((r,n)=>{let o=null,i=0,s=!1,a=()=>s&&!o&&n.complete();r.subscribe(I(n,u=>{o?.unsubscribe();let c=0,l=i++;P(t(u,l)).subscribe(o=I(n,d=>n.next(e?e(u,d,l,c++):d),()=>{o=null,a()}))},()=>{s=!0,a()}))})}function dy(t,e){return M(e)?ue(()=>t,e):ue(()=>t)}function ui(t){return b((e,r)=>{P(t).subscribe(I(r,()=>r.complete(),He)),!r.closed&&e.subscribe(r)})}function fy(t,e=!1){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{let s=t(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function ne(t,e,r){let n=M(t)||e||r?{next:t,error:e,complete:r}:t;return n?b((o,i)=>{var s;(s=n.subscribe)===null||s===void 0||s.call(n);let a=!0;o.subscribe(I(i,u=>{var c;(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},()=>{var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},u=>{var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},()=>{var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):le}function hy(...t){let e=Fn(t);return b((r,n)=>{let o=t.length,i=new Array(o),s=t.map(()=>!1),a=!1;for(let u=0;u<o;u++)P(t[u]).subscribe(I(n,c=>{i[u]=c,!a&&!s[u]&&(s[u]=!0,(a=s.every(le))&&(s=null))},He));r.subscribe(I(n,u=>{if(a){let c=[u,...i];n.next(e?e(...c):c)}}))})}var Yd=null;var Na=1;function se(t){let e=Yd;return Yd=t,e}var Qd={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function py(t){if(!(Pa(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Na)){if(!t.producerMustRecompute(t)&&!Ra(t)){t.dirty=!1,t.lastCleanEpoch=Na;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=Na}}function Kd(t){return t&&(t.nextProducerIndex=0),se(t)}function Jd(t,e){if(se(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(Pa(t))for(let r=t.nextProducerIndex;r<t.producerNode.length;r++)Oa(t.producerNode[r],t.producerIndexOfThis[r]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function Ra(t){ci(t);for(let e=0;e<t.producerNode.length;e++){let r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version||(py(r),n!==r.version))return!0}return!1}function Xd(t){if(ci(t),Pa(t))for(let e=0;e<t.producerNode.length;e++)Oa(t.producerNode[e],t.producerIndexOfThis[e]);t.producerNode.length=t.producerLastReadVersion.length=t.producerIndexOfThis.length=0,t.liveConsumerNode&&(t.liveConsumerNode.length=t.liveConsumerIndexOfThis.length=0)}function Oa(t,e){if(gy(t),ci(t),t.liveConsumerNode.length===1)for(let n=0;n<t.producerNode.length;n++)Oa(t.producerNode[n],t.producerIndexOfThis[n]);let r=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[r],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[r],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let n=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];ci(o),o.producerIndexOfThis[n]=e}}function Pa(t){return t.consumerIsAlwaysLive||(t?.liveConsumerNode?.length??0)>0}function ci(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function gy(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function my(){throw new Error}var vy=my;function ef(t){vy=t}function z(t){for(let e in t)if(t[e]===z)return e;throw Error("Could not find renamed property on target object.")}function li(t,e){for(let r in e)e.hasOwnProperty(r)&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function ge(t){if(typeof t=="string")return t;if(Array.isArray(t))return"["+t.map(ge).join(", ")+"]";if(t==null)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;let e=t.toString();if(e==null)return""+e;let r=e.indexOf(`
|
|
4
4
|
`);return r===-1?e:e.substring(0,r)}function Ka(t,e){return t==null||t===""?e===null?"":e:e==null||e===""?t:t+" "+e}var yy=z({__forward_ref__:z});function zf(t){return t.__forward_ref__=zf,t.toString=function(){return ge(this())},t}function we(t){return Wf(t)?t():t}function Wf(t){return typeof t=="function"&&t.hasOwnProperty(yy)&&t.__forward_ref__===zf}function Gf(t){return t&&!!t.\u0275providers}var qf="https://g.co/ng/security#xss",v=class extends Error{constructor(e,r){super(Wi(e,r)),this.code=e}};function Wi(t,e){return`${`NG0${Math.abs(t)}`}${e?": "+e:""}`}var Dy=z({\u0275cmp:z}),wy=z({\u0275dir:z}),Cy=z({\u0275pipe:z}),Ey=z({\u0275mod:z}),bi=z({\u0275fac:z}),Nr=z({__NG_ELEMENT_ID__:z}),tf=z({__NG_ENV_ID__:z});function an(t){return typeof t=="string"?t:t==null?"":String(t)}function Iy(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():an(t)}function by(t,e){let r=e?`. Dependency path: ${e.join(" > ")} > ${t}`:"";throw new v(-200,`Circular dependency in DI detected for ${t}${r}`)}function cc(t,e){let r=e?` in ${e}`:"";throw new v(-201,!1)}function My(t,e){t==null&&Sy(e,t,null,"!=")}function Sy(t,e,r,n){throw new Error(`ASSERTION ERROR: ${t}`+(n==null?"":` [Expected=> ${r} ${n} ${e} <=Actual]`))}function w(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function St(t){return{providers:t.providers||[],imports:t.imports||[]}}function Gi(t){return nf(t,Yf)||nf(t,Qf)}function Zf(t){return Gi(t)!==null}function nf(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ty(t){let e=t&&(t[Yf]||t[Qf]);return e||null}function rf(t){return t&&(t.hasOwnProperty(of)||t.hasOwnProperty(xy))?t[of]:null}var Yf=z({\u0275prov:z}),of=z({\u0275inj:z}),Qf=z({ngInjectableDef:z}),xy=z({ngInjectorDef:z}),F=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(F||{}),Ja;function Kf(){return Ja}function be(t){let e=Ja;return Ja=t,e}function Jf(t,e,r){let n=Gi(t);if(n&&n.providedIn=="root")return n.value===void 0?n.value=n.factory():n.value;if(r&F.Optional)return null;if(e!==void 0)return e;cc(ge(t),"Injector")}var X=globalThis;var E=class{constructor(e,r){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof r=="number"?this.__NG_ELEMENT_ID__=r:r!==void 0&&(this.\u0275prov=w({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};var _y={},Or=_y,Xa="__NG_DI_FLAG__",Mi="ngTempTokenPath",Ay="ngTokenPath",Ny=/\n/gm,Ry="\u0275",sf="__source",zn;function Oy(){return zn}function Ut(t){let e=zn;return zn=t,e}function Py(t,e=F.Default){if(zn===void 0)throw new v(-203,!1);return zn===null?Jf(t,void 0,e):zn.get(t,e&F.Optional?null:void 0,e)}function y(t,e=F.Default){return(Kf()||Py)(we(t),e)}function g(t,e=F.Default){return y(t,qi(e))}function qi(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function eu(t){let e=[];for(let r=0;r<t.length;r++){let n=we(t[r]);if(Array.isArray(n)){if(n.length===0)throw new v(900,!1);let o,i=F.Default;for(let s=0;s<n.length;s++){let a=n[s],u=Fy(a);typeof u=="number"?u===-1?o=a.token:i|=u:o=a}e.push(y(o,i))}else e.push(y(n))}return e}function Xf(t,e){return t[Xa]=e,t.prototype[Xa]=e,t}function Fy(t){return t[Xa]}function ky(t,e,r,n){let o=t[Mi];throw e[sf]&&o.unshift(e[sf]),t.message=Ly(`
|