dealpos 12.2.6 → 12.2.7

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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[3337],{63385:(T,P,d)=>{d.d(P,{$:()=>t});var t=(()=>{return(s=t||(t={}))[s.DealPOS=1]="DealPOS",s[s.Tada=2]="Tada",t;var s})()},71378:(T,P,d)=>{d.d(P,{q:()=>t});var t=(()=>{return(s=t||(t={}))[s.Park=1]="Park",s[s.Payment=3]="Payment",s[s.Bill=2]="Bill",t;var s})()},77890:(T,P,d)=>{d.d(P,{_:()=>t});var t=(()=>{return(s=t||(t={}))[s.CashAndPoint=0]="CashAndPoint",s[s.Cash=1]="Cash",s[s.Point=2]="Point",t;var s})()},16571:(T,P,d)=>{d.d(P,{J:()=>t});var t=(()=>{return(s=t||(t={}))[s.Any=0]="Any",s[s.Standard=1]="Standard",s[s.NonInventory=2]="NonInventory",s[s.Composite=3]="Composite",s[s.Serialized=4]="Serialized",s[s.Manufactured=5]="Manufactured",s[s.Complementary=6]="Complementary",s[s.MultipleUOM=7]="MultipleUOM",s[s.PrepaidPoint=8]="PrepaidPoint",s[s.PrepaidPackage=10]="PrepaidPackage",t;var s})()},63631:(T,P,d)=>{d.d(P,{m:()=>a});var t=d(81180),s=d(67327);class a{constructor(){(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"Number",void 0),(0,t.Z)(this,"Due",void 0),(0,t.Z)(this,"Date",void 0),(0,t.Z)(this,"CustomDateField",void 0),(0,t.Z)(this,"TimeCustom",void 0),(0,t.Z)(this,"DateCustom",void 0),(0,t.Z)(this,"SurchargePcg",void 0),(0,t.Z)(this,"TempSurchargePcg",void 0),(0,t.Z)(this,"ToP",void 0),(0,t.Z)(this,"Note",void 0),(0,t.Z)(this,"ReferenceInvoiceID",void 0),(0,t.Z)(this,"PaymentStateID",void 0),(0,t.Z)(this,"Sales",void 0),this.ID=s.gT.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0}}},52029:(T,P,d)=>{d.d(P,{Q:()=>s});var t=d(81180);class s{constructor(){(0,t.Z)(this,"Name",void 0),(0,t.Z)(this,"Phone",void 0),(0,t.Z)(this,"Address",void 0),(0,t.Z)(this,"City",void 0),this.Name="",this.Phone="",this.Address="",this.City=""}}},42763:(T,P,d)=>{d.d(P,{N:()=>D});var t=d(81180),s=d(16571),a=d(67327);class D{get Total(){const o=this.GrossTotal-this.DiscountPercentAmount;return this.validateDiscountAmount(o),o-this.DiscountAmount*this.Quantity}validateDiscountAmount(o){o>0&&this.DiscountAmount>o&&(this.DiscountAmount=o)}get GrossTotal(){return this.Price*(this.Quantity*this.UnitQuantity)||0}get DiscountPercentAmount(){return this.Discount?this.GrossTotal*this.Discount/100:0}constructor(){(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"VariantID",void 0),(0,t.Z)(this,"Quantity",void 0),(0,t.Z)(this,"Cost",void 0),(0,t.Z)(this,"Price",void 0),(0,t.Z)(this,"Expense",void 0),(0,t.Z)(this,"UnitPriceOriginal",void 0),(0,t.Z)(this,"Discount",void 0),(0,t.Z)(this,"DiscountAmount",void 0),(0,t.Z)(this,"Note",void 0),(0,t.Z)(this,"Taxable",void 0),(0,t.Z)(this,"LoyaltyPoint",void 0),(0,t.Z)(this,"EntityID",void 0),(0,t.Z)(this,"UnitQuantity",void 0),(0,t.Z)(this,"VariantUnitQuantity",void 0),(0,t.Z)(this,"UnitQuantityPrice",void 0),(0,t.Z)(this,"PriceTypeID",void 0),(0,t.Z)(this,"PriceNote",void 0),(0,t.Z)(this,"Index",void 0),(0,t.Z)(this,"Splited",void 0),(0,t.Z)(this,"InventoryTypeID",void 0),(0,t.Z)(this,"TypeID",void 0),(0,t.Z)(this,"Variant",void 0),(0,t.Z)(this,"EntityName",void 0),(0,t.Z)(this,"SalesID",void 0),(0,t.Z)(this,"SalesName",void 0),(0,t.Z)(this,"PriceBookID",void 0),(0,t.Z)(this,"Serial",void 0),(0,t.Z)(this,"UnitExpense",void 0),(0,t.Z)(this,"UnitCost",void 0),(0,t.Z)(this,"UnitPrice",void 0),(0,t.Z)(this,"Checked",void 0),(0,t.Z)(this,"SplitQuantity",void 0),(0,t.Z)(this,"PurchaseOrderID",void 0),(0,t.Z)(this,"isMaxInventory",void 0),(0,t.Z)(this,"SerialSource",void 0),(0,t.Z)(this,"isCopyPromotionName",void 0),(0,t.Z)(this,"isCopyProdDesc",void 0),this.EntityID=a.gT.GuidEmpty,this.ID=a.gT.GuidEmpty,this.Note="",this.SplitQuantity=0,this.SalesID="",this.Quantity=1}patchByVariant(o,u,g){this.PriceTypeID=o.PriceTypeID,this.Variant=o,this.VariantID=o.ID,this.isCopyPromotionName=g,this.isCopyProdDesc=this.isCopyProdDesc=u,this.setItemNote(o),this.UnitQuantity=o.UnitQuantity,o.UnitQuantity>1&&(this.UnitQuantityPrice=this.Variant.UnitPrice/this.Variant.UnitQuantity),this.Price=o.UnitPrice,this.UnitPrice=o.UnitPrice,this.Cost=o.UnitCost,this.UnitCost=o.UnitCost,this.Expense=o.UnitCost,this.Discount=o.PriceDiscount,this.UnitPriceOriginal=o.UnitPriceOriginal,this.DiscountAmount=0,this.Taxable=o.Taxable,this.InventoryTypeID=o.TypeID,this.LoyaltyPoint=o.LoyaltyPoint,this.VariantUnitQuantity=o.VariantUnitQuantity,this.SalesID="",this.setByVariantType(o),this.setItemNote(o)}setByVariantType(o){switch(o.TypeID){case s.J.NonInventory:o.Config&&(this.Cost=this.Total/this.Quantity);break;case s.J.Serialized:this.Serial=o.Serial}}setItemNote(o){o.TypeID!=s.J.Serialized&&(this.isCopyProdDesc&&(this.Note=o.Description),this.isCopyPromotionName&&a.gT.IsNotEmpty(o.PriceNote)&&(this.Note=a.gT.IsNotEmpty(o.PriceNote)?o.PriceNote:this.Note))}pricebookUpdate(o,u,g){if(this.PriceBookID&&u){const e=this.getSelectedPricebook(this.PriceBookID);a.gT.IsNotEmpty(this.Note)&&a.gT.IsNotEmpty(e)&&this.Note.replace(e.Name,"")}this.PriceBookID=o;const p=this.getSelectedPricebook(o);p?(this.Price=p.UnitPrice,this.Discount=p.PriceDiscount,this.Cost=null==p.UnitCost?this.Variant.UnitCost:p.UnitCost,this.PriceTypeID=2,g&&(this.Note=p.Name),this.PriceNote=p.Name):(this.Price=this.Variant.UnitPrice,this.Discount=this.Variant.PriceDiscount,this.Cost=this.Variant.UnitCost,this.PriceTypeID=0,this.setItemNote(this.Variant))}getPricebookByQuantity(){let o=0,u=null;return this.Variant.PriceBook&&this.Variant.PriceBook.length>0&&this.Variant.PriceBook.filter(p=>p.MinimumQuantity<=this.Quantity).forEach(p=>{o<=p.MinimumQuantity&&p.MinimumQuantity>0&&(u=p.ID,o=p.MinimumQuantity)}),u}updatePriceStatus(o){if(this.Price!=this.Variant.UnitPrice){const u=this.getSelectedPricebook(o);u&&u.UnitPrice==this.Price?(this.PriceTypeID=2,this.PriceNote=u.Name):this.PriceTypeID=1}}getSelectedPricebook(o){if(this.Variant.PriceBook){const u=this.Variant.PriceBook.filter(g=>g.ID==o);if(u.length)return u[0]}return null}checkMatchSerialWithQuantity(){let o=!0;return this.isSerialType()&&this.Quantity!==this.calculateSerialQty()&&(o=!1),o}calculateSerialQty(){let o=0;return this.Serial&&this.Serial.forEach(u=>{o+=u.Quantity}),o}isSerialType(){let o=!1;return this.Variant?.TypeID===s.J.Serialized&&(o=!0),o}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}}},94768:(T,P,d)=>{d.d(P,{t:()=>a});var t=d(81180),s=d(42763);class a extends s.N{constructor(){super(),(0,t.Z)(this,"Variants",void 0),(0,t.Z)(this,"PromotionGift",void 0),(0,t.Z)(this,"TotalWithoutDiscount",void 0),this.PromotionGift=!1,this.isMaxInventory=!1}}},23389:(T,P,d)=>{d.d(P,{j:()=>s});var t=d(81180);class s{constructor(D,l,o,u){(0,t.Z)(this,"MethodID",void 0),(0,t.Z)(this,"Amount",0),(0,t.Z)(this,"Note",void 0),(0,t.Z)(this,"Index",void 0),(0,t.Z)(this,"Date",void 0),(0,t.Z)(this,"PaidAmount",void 0),(0,t.Z)(this,"Code",void 0),(0,t.Z)(this,"MethodName",void 0),(0,t.Z)(this,"InvoiceID",void 0),(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"TypeID",void 0),this.MethodID=D||0,this.Amount=l||0,this.PaidAmount=o||0,this.Date=u instanceof Date?u.toDateString():u}}},75033:(T,P,d)=>{d.d(P,{m:()=>L});var t=d(81180),s=d(70655),a=d(63631),D=d(67327),l=(()=>{return(I=l||(l={}))[I.Unsent=1]="Unsent",I[I.Partial=2]="Partial",I[I.Sent=3]="Sent",l;var I})(),o=d(63385);class u{constructor(){(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"EntityID",void 0),(0,t.Z)(this,"RegisterID",void 0),(0,t.Z)(this,"TypeID",void 0),(0,t.Z)(this,"Date",void 0),(0,t.Z)(this,"Number",void 0),(0,t.Z)(this,"CustomerID",void 0),(0,t.Z)(this,"SalesID",void 0),(0,t.Z)(this,"Discount",0),(0,t.Z)(this,"Discount2",0),(0,t.Z)(this,"DiscountAmount",0),(0,t.Z)(this,"Note",""),(0,t.Z)(this,"DeliveryOutletID",void 0),(0,t.Z)(this,"TaxTypeID",void 0),(0,t.Z)(this,"CurrencyID",void 0),(0,t.Z)(this,"CurrencyRate",void 0),(0,t.Z)(this,"PointUsed",void 0),(0,t.Z)(this,"InvoicedStateID",void 0),(0,t.Z)(this,"ReferenceNumber",""),(0,t.Z)(this,"LogisticsServiceID",void 0),(0,t.Z)(this,"ParkLabel",""),(0,t.Z)(this,"NumberOfPerson",void 0),(0,t.Z)(this,"ClientTimestamp",void 0),(0,t.Z)(this,"Created",void 0),(0,t.Z)(this,"AuthorizationKey",""),(0,t.Z)(this,"CouponType",o.$.DealPOS),(0,t.Z)(this,"AuthorizationNote",""),(0,t.Z)(this,"DeliveryStateID",void 0),(0,t.Z)(this,"Att",""),this.ID=D.gT.GuidEmpty,this.EntityID=D.gT.GuidEmpty,this.RegisterID=D.gT.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=D.gT.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=l.Unsent,this.PointUsed=0,this.NumberOfPerson=1,this.Date=(new Date).toJSON(),this.Att=""}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}}var g=d(23389),p=d(52029),e=d(71378);class E{constructor(){(0,t.Z)(this,"DeliveryEntityID",void 0),(0,t.Z)(this,"Type",void 0),(0,t.Z)(this,"Retur",void 0),(0,t.Z)(this,"NewOrderID",void 0),this.DeliveryEntityID="",this.Type=e.q.Payment,this.Retur=!1}}var x=d(94768),B=d(42763),w=d(77890),R=d(16571),N=d(43429);class L{get cartQuantity(){let Z=0;for(let r of this.CartItems)Z+=r.Quantity;return Z}constructor(){(0,t.Z)(this,"Order",void 0),(0,t.Z)(this,"Invoice",void 0),(0,t.Z)(this,"Shipping",void 0),(0,t.Z)(this,"Action",void 0),(0,t.Z)(this,"Payments",void 0),(0,t.Z)(this,"Items",void 0),(0,t.Z)(this,"CartItems",void 0),(0,t.Z)(this,"ContactName",void 0),(0,t.Z)(this,"LocalParkID",void 0),(0,t.Z)(this,"Message",void 0),this.Order=new u,this.Invoice=new a.m,this.Shipping=new p.Q,this.Action=new E,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}emptyCart(){this.Items=[]}isCartEmpty(){return 0==this.Items.length}get TotalPaidAmount(){let Z=0;return this.Payments.forEach(r=>{Z+=r.PaidAmount}),Z}get RedeemableAmount(){let Z=this.CartItems.filter(r=>r.Variant.PaymentTypeID!=w._.Cash);return this.GetAmountByCart(Z)}get TotalQuantity(){let Z=0;return this.CartItems.forEach(r=>{r.PromotionGift||(Z+=r.Quantity)}),Z}get CashOnlyAmount(){let Z=this.CartItems.filter(r=>r.Variant.PaymentTypeID==w._.Cash);return this.GetAmountByCart(Z)}get PointOnlyAmount(){let Z=this.CartItems.filter(r=>r.Variant.PaymentTypeID==w._.Point);return this.GetAmountByCart(Z)}get PrepaidPackageItem(){return this.CartItems.filter(r=>r.Variant.TypeID==R.J.PrepaidPackage)}GetAmountByCart(Z){let r=0;return Z.forEach(c=>{r+=c.Total}),r=r*(100-this.Order.Discount)/100,r=r*(100-this.Order.Discount2)/100,r}}(0,s.gn)([(0,N.D)(()=>u)],L.prototype,"Order",void 0),(0,s.gn)([(0,N.D)(()=>a.m)],L.prototype,"Invoice",void 0),(0,s.gn)([(0,N.D)(()=>p.Q)],L.prototype,"Shipping",void 0),(0,s.gn)([(0,N.D)(()=>E)],L.prototype,"Action",void 0),(0,s.gn)([(0,N.D)(()=>g.j)],L.prototype,"Payments",void 0),(0,s.gn)([(0,N.D)(()=>B.N)],L.prototype,"Items",void 0),(0,s.gn)([(0,N.D)(()=>x.t)],L.prototype,"CartItems",void 0)},13337:(T,P,d)=>{d.d(P,{T:()=>L});var t=d(81180),s=d(88996),a=d(75033),D=d(50494),l=d(54004),o=d(63900),u=d(39300),g=d(24351),p=d(70262),e=d(907),E=d(29990),x=d(94650),B=d(58966),w=d(89156),R=d(85421),N=d(97185);let L=(()=>{class I{constructor(r,c,i,n){(0,t.Z)(this,"httpService",void 0),(0,t.Z)(this,"dbService",void 0),(0,t.Z)(this,"toastrService",void 0),this.httpService=c,this.dbService=i,this.toastrService=n}get hasConnection(){return navigator.onLine}isProductFromServer(){return this.getOfflineConfig().pipe((0,l.U)(r=>null==r||!r.productUsingLocal&&this.hasConnection))}isConfigFromServer(){return this.getOfflineConfig().pipe((0,l.U)(r=>!r.configUsingLocal&&this.hasConnection))}isStoreOrderInServer(){return this.getOfflineConfig().pipe((0,l.U)(r=>null==r||!r.orderUsingLocal&&this.hasConnection))}getPOSStorage(){return this.dbService.getByID(e.Z.POSStorage,1)}syncPOSStorage(r){return r.id=1,this.dbService.getByID(e.Z.POSStorage,1).pipe((0,o.w)(c=>null==c?this.dbService.add(e.Z.POSStorage,r):this.dbService.update(e.Z.POSStorage,r)),(0,l.U)(c=>r))}syncOrder(r){return this.dbService.add(e.Z.Order,r)}findAllOrders(){return this.dbService.getAll(e.Z.Order)}uploadOrders(){return this.findAllOrders().pipe((0,u.h)(r=>r.length>0),(0,g.b)(r=>(0,s.D)(r).pipe((0,g.b)(i=>this.uploadOrderProcess(i)))))}uploadOrderProcess(r){let c=r.Order.Number,i=this.createOrderForSubmission(r);return this.httpService.post("/API/POS/SubmitOrder",i).pipe((0,o.w)(n=>n.Success?(this.toastrService.success(`Order with number ${c} synchronized to server`,"Success"),this.removeOrder(r.id)):(this.toastrService.error(`Failed to upload order with number ${c}`,"Error!"),this.syncFailedOrder(r).pipe((0,l.U)(h=>!1)))),(0,p.K)(n=>(this.toastrService.error(`Failed to upload order with number ${c}`,"Error!"),this.syncFailedOrder(r).pipe((0,l.U)(h=>!1)))))}removeOrder(r){return this.dbService.deleteByKey(e.Z.Order,r)}createOrderForSubmission(r){let c=Object.assign({},r);return delete c.CartItems,delete c.Message,c}syncFailedOrder(r){const c=(0,D.d8)(a.m,r);return this.dbService.add(e.Z.FailedOrder,c).pipe((0,o.w)(i=>this.removeOrder(r.id)))}uploadFailedOrder(r){let c=this.createOrderForSubmission(r);return this.httpService.post("/API/POS/SubmitOrder",c).pipe((0,o.w)(()=>this.removeFailedOrder(r.id)))}getFailedOrders(){return this.dbService.getAll(e.Z.FailedOrder)}removeFailedOrder(r){return this.dbService.deleteByKey(e.Z.FailedOrder,r)}syncVariants(r){return this.dbService.getAll(e.Z.Product).pipe((0,o.w)(c=>0==c.length?this.dbService.bulkAdd(e.Z.Product,r):this.dbService.clear(e.Z.Product).pipe((0,o.w)(i=>{if(i)return this.dbService.bulkAdd(e.Z.Product,r)}))))}findAllVariant(){return this.dbService.getAll(e.Z.Product)}findVariantById(r){return this.dbService.getByID(e.Z.Product,r).pipe((0,u.h)(c=>this.warningNotFound(c,E.g.failGetLocalVariant)),(0,o.w)(c=>this.findOutletPriceVariant(c)))}findVariantByCode(r){return this.dbService.getByIndex(e.Z.Product,"Code",r).pipe((0,u.h)(c=>this.warningNotFound(c,E.g.failGetLocalVariant)),(0,o.w)(c=>this.findOutletPriceVariant(c)))}findOutletPriceVariant(r){return this.dbService.getByIndex(e.Z.OutletPrice,"VariantID",r.ID).pipe((0,l.U)(c=>(c&&(r.UnitPrice=c.UnitPrice,r.PriceDiscount=c.PriceDiscount),r)))}warningNotFound(r,c){return!!r||(this.toastrService.warning(c,"Warning"),!1)}syncOutletPrice(r){return this.dbService.getAll(e.Z.OutletPrice).pipe((0,o.w)(c=>0==c.length?this.dbService.bulkAdd(e.Z.OutletPrice,r):this.dbService.clear(e.Z.OutletPrice).pipe((0,o.w)(i=>{if(i)return this.dbService.bulkAdd(e.Z.OutletPrice,r)}))))}findAllOutletPrices(){return this.dbService.getAll(e.Z.OutletPrice)}syncRegisters(r){return this.dbService.getAll(e.Z.Outlet).pipe((0,o.w)(c=>0==c.length?this.dbService.bulkAdd(e.Z.Outlet,r):this.dbService.clear(e.Z.Outlet).pipe((0,o.w)(i=>{if(i)return this.dbService.bulkAdd(e.Z.Outlet,r)}))))}findRegisterByID(r){return this.dbService.getByID(e.Z.Outlet,r)}findAllRegister(){return this.dbService.getAll(e.Z.Outlet)}getSyncTime(){return this.dbService.getByID(e.Z.SyncTime,1)}updateSyncTime(){return this.dbService.getByID(e.Z.SyncTime,1).pipe((0,o.w)(r=>{const c={id:1,time:(new Date).toString()};return r?this.dbService.update(e.Z.SyncTime,c):this.dbService.add(e.Z.SyncTime,c)}))}updateOfflineConfig(r){let c={id:1,configUsingLocal:r.configUsingLocal,orderUsingLocal:r.orderUsingLocal,productUsingLocal:r.productUsingLocal};return this.dbService.getByID(e.Z.OfflineConfig,1).pipe((0,o.w)(i=>null==i?this.dbService.add(e.Z.OfflineConfig,c):this.dbService.update(e.Z.OfflineConfig,c)))}getOfflineConfig(){return this.dbService.getByID(e.Z.OfflineConfig,1)}}return(0,t.Z)(I,"\u0275fac",function(r){return new(r||I)(x.LFG(B.X),x.LFG(w.O),x.LFG(R.ys),x.LFG(N._W))}),(0,t.Z)(I,"\u0275prov",x.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"})),I})()},29990:(T,P,d)=>{d.d(P,{g:()=>s});var t=d(81180);let s=(()=>{class a{}return(0,t.Z)(a,"emptyDate","Please fill invoice date"),(0,t.Z)(a,"emptyNumber","Please fill invoice number"),(0,t.Z)(a,"emptyOrderNumber","Number is Required"),(0,t.Z)(a,"failGetMenu","Fail to get pos menu"),(0,t.Z)(a,"failToGetRetur","Fail to get retur"),(0,t.Z)(a,"failGetLocalPosStorage","Fail to get setting and option from local storage, Please re-cache your data while online!"),(0,t.Z)(a,"failGetVariant",'"Error getting variant with {0} {1}" - {2}'),(0,t.Z)(a,"failGetLocalVariant","Fail to get variant from local storage, Please re-cache your data while online!"),(0,t.Z)(a,"emptyBarcodeFormat",'No product with barcode "{0}"'),(0,t.Z)(a,"emptyCustomerFormat",'No customer with code "{0}"'),(0,t.Z)(a,"failGetSalesOrder","Fail to get sales order"),(0,t.Z)(a,"failBin","Fail to bin transaction"),(0,t.Z)(a,"failGetCustomer","Fail to get customer's data"),(0,t.Z)(a,"failCreateCustomer","Fail to create customer"),(0,t.Z)(a,"noRoleContact","You have no right to create new customer"),(0,t.Z)(a,"submitLocally","Connection unavailable ~ offline! Order stored locally"),(0,t.Z)(a,"OfflineOrderNotSupport","Offline order is not Supported!"),(0,t.Z)(a,"failOrderConnectionTimeOut","Connection timeout! Please try uploading your order again!"),(0,t.Z)(a,"failDeletePark","Fail to delete park"),(0,t.Z)(a,"emptyAccessRegister","You do not have access to any Register"),(0,t.Z)(a,"failGenerateNewNumber","Fail to generate new number"),(0,t.Z)(a,"emptyPayment","There is no active payment method."),(0,t.Z)(a,"failOpenRegister","Fail to open register"),(0,t.Z)(a,"failGetLocalOutletInfo","Fail to get outlet information from local storage, Please re-cache your data while online!"),(0,t.Z)(a,"failTrySubmit","[Error submitting order] \n{0}"),(0,t.Z)(a,"failTryCreateCustomer",'"[Error creating customer] \n"{0}'),(0,t.Z)(a,"createCustomerOffline","Create customer is not supported when the connection offline"),(0,t.Z)(a,"emptyCustomer","Please select customer!"),(0,t.Z)(a,"emptySalesPerson","Please select sales person!"),(0,t.Z)(a,"emptySalesType","Please select sales type!"),(0,t.Z)(a,"failCreateNewVariant","Fail to create new variant"),(0,t.Z)(a,"requiredDefaultCategory","[WARNING] - POS / Quick Create Product requires Default Category"),(0,t.Z)(a,"emptyVariant","Item is undefined, please re-type"),(0,t.Z)(a,"emptyPOItem","You must have at least one item"),(0,t.Z)(a,"emptyEntity","Please select entity before proceeding.."),(0,t.Z)(a,"failGetRetrieve","Fail to get retrieve"),(0,t.Z)(a,"failTryPark","[Error submitting park] \n{0}"),(0,t.Z)(a,"failTryGetPark","[Error during get park] \n{0}"),(0,t.Z)(a,"failTryGetOutStanding","[Error during get outstanding] \n{0}"),(0,t.Z)(a,"failTryGetParkSelect","[Error during get available park select] \n{0}"),(0,t.Z)(a,"failGetSerial","Fail to get variant serial"),(0,t.Z)(a,"successSendOrder","Orders synchronized to server. Upload Transaction Complete!"),(0,t.Z)(a,"successSyncProduct","Products synchronized to Local Storage"),(0,t.Z)(a,"failGetPark","Fail to get park"),(0,t.Z)(a,"failMergePark","Fail to merge park"),(0,t.Z)(a,"failGetOutStanding","Fail to get outstanding"),(0,t.Z)(a,"failGetParkSelect","Fail to get available park select"),(0,t.Z)(a,"confirmationDeleteOrder","Are you sure want to delete this order?"),(0,t.Z)(a,"confirmationCloseRegister","The Register is still occupied under '{0}'. Do you want to end his / her session?"),(0,t.Z)(a,"closeActiveRegister","You already have an active register with name '{0}'. Do you want to end your session?"),(0,t.Z)(a,"successSendEmail","Email is sent successfully to '{0}'"),(0,t.Z)(a,"wrongOfflineAction","This action is not supported when the connection offline"),(0,t.Z)(a,"emptyCustomerCredit","Credit Payment requires customer specified!"),(0,t.Z)(a,"debtLimit","Your debt is over limit!"),(0,t.Z)(a,"emptyCustomerDeposit","Deposit Payment requires customer specified!"),(0,t.Z)(a,"creditLock","You have no right to give credit!"),(0,t.Z)(a,"failToSyncProduct","Fail sync product to local storage!"),(0,t.Z)(a,"failToSyncOrder","Fail sync Order to local storage!"),(0,t.Z)(a,"emptyDeliveryOutlet","There is no outlet in delivery module."),(0,t.Z)(a,"wrongAuthorizationCode","Wrong Authorize Code!"),(0,t.Z)(a,"priceMinimumRestriction","You have no right to sell this item lower than {0}"),(0,t.Z)(a,"clearBrowsingData","A new version of our POS is available, please clear your browsing data to apply changes!"),(0,t.Z)(a,"offlineModeNotification","WARNING! Your point of sale configuration is set to LOCAL, orders are not synchronized automatically."),(0,t.Z)(a,"failServerConnection","Something happen to the server, switch query to local mode to continue work!"),(0,t.Z)(a,"taxEmpty","Tax options is empty, go to setup and add tax!"),(0,t.Z)(a,"clearCommission","Are you sure to leave this page without saving?"),(0,t.Z)(a,"voidConfirm","This will replace current order's item(s) with blank order."),(0,t.Z)(a,"notSellAble","This item is not for sell"),(0,t.Z)(a,"partialLoyaltyPointUnable","You only can fully pay with loyalty point, otherwise please remove the loyalty point and use other available payment options"),(0,t.Z)(a,"DiffDate","Client date is not equal with Server Date"),(0,t.Z)(a,"pointOnly","{0} need paid by point only"),(0,t.Z)(a,"cashOnly","{0} cannot paid by point"),(0,t.Z)(a,"ovoConfig","WARNING! Your ovo configuration is not set"),(0,t.Z)(a,"failGenerateQR","Failed to generate qr code"),(0,t.Z)(a,"failPaymentOvo","Failed to pay with ovo, Try again"),(0,t.Z)(a,"emptyPhone","Please Fill Phone"),(0,t.Z)(a,"maxInventory","Your Bought Qty will exceed the Max Inventory"),(0,t.Z)(a,"payNowOnly","You have no access to sell with Later Payment"),a})()},58966:(T,P,d)=>{d.d(P,{X:()=>Z});var t=d(81180),s=d(39646),a=d(60515),D=d(18505),l=d(63900),o=d(54004),u=d(70262),g=d(36895),p=d(65412),e=d(94650);function E(r,c){if(1&r&&e._UZ(0,"button",13),2&r){const i=e.oxw().index;e.uIk("data-bs-slide-to",i)}}function x(r,c){if(1&r&&(e.ynx(0),e.YNc(1,E,1,1,"button",12),e.BQk()),2&r){const i=c.index;e.xp6(1),e.Q6J("ngIf",0!=i)}}function B(r,c){if(1&r&&(e.TgZ(0,"div",10),e._UZ(1,"button",11),e.YNc(2,x,2,1,"ng-container",9),e.qZA()),2&r){const i=e.oxw();e.xp6(1),e.uIk("data-bs-slide-to",0),e.xp6(1),e.Q6J("ngForOf",i.changelogs)}}function w(r,c){if(1&r&&(e.TgZ(0,"div",15),e._UZ(1,"img",6),e.TgZ(2,"h2")(3,"a",7),e._uU(4),e.qZA()(),e.TgZ(5,"p",8),e._uU(6),e.qZA()()),2&r){const i=e.oxw().$implicit;e.xp6(1),e.Q6J("src",i.ImageSource,e.LSH),e.xp6(2),e.Q6J("href",i.Href,e.LSH),e.xp6(1),e.Oqu(i.Title),e.xp6(2),e.hij(" ",i.Description," ")}}function R(r,c){if(1&r&&(e.ynx(0),e.YNc(1,w,7,4,"div",14),e.BQk()),2&r){const i=c.index;e.xp6(1),e.Q6J("ngIf",0!=i)}}let N=(()=>{class r{constructor(i,n){(0,t.Z)(this,"dialogRef",void 0),(0,t.Z)(this,"changelogs",[]),this.dialogRef=n,this.changelogs=i}close(){this.dialogRef.close()}}return(0,t.Z)(r,"\u0275fac",function(i){return new(i||r)(e.Y36(p.WI),e.Y36(p.so))}),(0,t.Z)(r,"\u0275cmp",e.Xpm({type:r,selectors:[["POS-modal-changelog"]],standalone:!0,features:[e.jDz],decls:14,vars:6,consts:[[1,"changelog-container","h-100"],["mat-button","",1,"close",3,"click"],["id","carouselExampleIndicators","data-bs-ride","carousel",1,"carousel","slide"],["class","carousel-indicators",4,"ngIf"],[1,"carousel-inner"],[1,"carousel-item","active"],["alt","",3,"src"],["target","_blank",3,"href"],[1,"description"],[4,"ngFor","ngForOf"],[1,"carousel-indicators"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true",1,"active"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true",4,"ngIf"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true"],["class","carousel-item",4,"ngIf"],[1,"carousel-item"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(){return n.close()}),e._uU(2,"X"),e.qZA(),e.TgZ(3,"div",2),e.YNc(4,B,3,2,"div",3),e.TgZ(5,"div",4)(6,"div",5),e._UZ(7,"img",6),e.TgZ(8,"h2")(9,"a",7),e._uU(10),e.qZA()(),e.TgZ(11,"p",8),e._uU(12),e.qZA()(),e.YNc(13,R,2,1,"ng-container",9),e.qZA()()()),2&i&&(e.xp6(4),e.Q6J("ngIf",n.changelogs.length>1),e.xp6(3),e.Q6J("src",n.changelogs[0].ImageSource,e.LSH),e.xp6(2),e.Q6J("href",n.changelogs[0].Href,e.LSH),e.xp6(1),e.Oqu(n.changelogs[0].Title),e.xp6(2),e.hij(" ",n.changelogs[0].Description," "),e.xp6(1),e.Q6J("ngForOf",n.changelogs))},dependencies:[g.ez,g.sg,g.O5],styles:[".changelog-container[_ngcontent-%COMP%]{position:relative;text-align:center}.changelog-container[_ngcontent-%COMP%] .carousel.slide[_ngcontent-%COMP%]{height:100%}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] [data-bs-target][_ngcontent-%COMP%]{background-color:#dbdfea}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] .active[_ngcontent-%COMP%]{background-color:#19a7ce}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:10px;border:0}.changelog-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:425px;width:100%}.changelog-container[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:20px}.changelog-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:10px!important;margin-bottom:15px!important;max-width:700px;font-size:15px;margin:0 auto}.changelog-container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{position:absolute;top:0;right:0;transform:translate(100%,-100%);background:white;padding:8px 13px;min-width:auto;border:none;border-radius:119px}"]})),r})();var L=d(89156),I=d(11481);let Z=(()=>{class r{constructor(i,n,h){(0,t.Z)(this,"http",void 0),(0,t.Z)(this,"matDialog",void 0),(0,t.Z)(this,"title",void 0),(0,t.Z)(this,"menu$",void 0),this.http=i,this.matDialog=n,this.title=h}setMenu$(){const i=this.getCurrentFormattedRoute();this.menu$=this.http.get(`/API/Menu/${i}`).pipe((0,D.b)(n=>this.title.setTitle(n.T)),(0,l.w)(n=>{let h=(0,s.of)(n);if(n.U.length>0){localStorage.getItem("mapRouteOpenChangelogDialog")||localStorage.setItem("mapRouteOpenChangelogDialog",JSON.stringify([]));const A=JSON.parse(localStorage.getItem("mapRouteOpenChangelogDialog"));A.includes(i)||(A.push(i),localStorage.setItem("mapRouteOpenChangelogDialog",JSON.stringify(A)),h=this.matDialog.open(N,{panelClass:"changelog-dialog",data:n.U,height:"550px",width:"800px"}).afterOpened().pipe((0,o.U)(()=>n)))}return h}),(0,u.K)(()=>a.E))}getCurrentFormattedRoute(){try{let i=window.location.href;return i=i.split("menu/")[1],i=i.split(";")[0],i}catch(i){console.log(i)}}}return(0,t.Z)(r,"\u0275fac",function(i){return new(i||r)(e.LFG(L.O),e.LFG(p.uw),e.LFG(I.Dx))}),(0,t.Z)(r,"\u0275prov",e.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"})),r})()},43429:(T,P,d)=>{d.d(P,{D:()=>s});var t=d(31061);function s(a,D={}){return function(l,o){const u=Reflect.getMetadata("design:type",l,o);t.m.addTypeMetadata({target:l.constructor,propertyName:o,reflectedType:u,typeFunction:a,options:D})}}},91415:(T,P,d)=>{d.d(P,{h:()=>t});var t=(()=>{return(s=t||(t={}))[s.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",s[s.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",s[s.CLASS_TO_CLASS=2]="CLASS_TO_CLASS",t;var s})()},50494:(T,P,d)=>{d.d(P,{d8:()=>B,yE:()=>w});var t=d(31061),s=d(91415);class o{constructor(i,n){this.transformationType=i,this.options=n,this.recursionStack=new Set}transform(i,n,h,A,_,v=0){if(Array.isArray(n)||n instanceof Set){const y=A&&this.transformationType===s.h.PLAIN_TO_CLASS?function l(c){const i=new c;return i instanceof Set||"push"in i?i:[]}(A):[];return n.forEach((f,S)=>{const U=i?i[S]:void 0;if(this.options.enableCircularCheck&&this.isCircular(f))this.transformationType===s.h.CLASS_TO_CLASS&&(y instanceof Set?y.add(f):y.push(f));else{let M;if("function"!=typeof h&&h&&h.options&&h.options.discriminator&&h.options.discriminator.property&&h.options.discriminator.subTypes){if(this.transformationType===s.h.PLAIN_TO_CLASS){M=h.options.discriminator.subTypes.find(k=>k.name===f[h.options.discriminator.property]);const b=h.typeFunction({newObject:y,object:f,property:void 0});M=void 0===M?b:M.value,h.options.keepDiscriminatorProperty||delete f[h.options.discriminator.property]}this.transformationType===s.h.CLASS_TO_CLASS&&(M=f.constructor),this.transformationType===s.h.CLASS_TO_PLAIN&&(f[h.options.discriminator.property]=h.options.discriminator.subTypes.find(O=>O.value===f.constructor).name)}else M=h;const F=this.transform(U,f,M,void 0,f instanceof Map,v+1);y instanceof Set?y.add(F):y.push(F)}}),y}if(h===String&&!_)return null==n?n:String(n);if(h===Number&&!_)return null==n?n:Number(n);if(h===Boolean&&!_)return null==n?n:Boolean(n);if((h===Date||n instanceof Date)&&!_)return n instanceof Date?new Date(n.valueOf()):null==n?n:new Date(n);if(function a(){return typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:void 0}().Buffer&&(h===Buffer||n instanceof Buffer)&&!_)return null==n?n:Buffer.from(n);if(function D(c){return null!==c&&"object"==typeof c&&"function"==typeof c.then}(n)&&!_)return new Promise((y,f)=>{n.then(S=>y(this.transform(void 0,S,h,void 0,void 0,v+1)),f)});if(!_&&null!==n&&"object"==typeof n&&"function"==typeof n.then)return n;if("object"==typeof n&&null!==n){!h&&n.constructor!==Object&&(!Array.isArray(n)&&n.constructor===Array||(h=n.constructor)),!h&&i&&(h=i.constructor),this.options.enableCircularCheck&&this.recursionStack.add(n);const y=this.getKeys(h,n,_);let f=i||{};!i&&(this.transformationType===s.h.PLAIN_TO_CLASS||this.transformationType===s.h.CLASS_TO_CLASS)&&(f=_?new Map:h?new h:{});for(const S of y){if("__proto__"===S||"constructor"===S)continue;const U=S;let O,M=S,F=S;if(!this.options.ignoreDecorators&&h)if(this.transformationType===s.h.PLAIN_TO_CLASS){const m=t.m.findExposeMetadataByCustomName(h,S);m&&(F=m.propertyName,M=m.propertyName)}else if(this.transformationType===s.h.CLASS_TO_PLAIN||this.transformationType===s.h.CLASS_TO_CLASS){const m=t.m.findExposeMetadata(h,S);m&&m.options&&m.options.name&&(M=m.options.name)}O=this.transformationType===s.h.PLAIN_TO_CLASS?n[U]:n instanceof Map?n.get(U):n[U]instanceof Function?n[U]():n[U];let b,k=O instanceof Map;if(h&&_)b=h;else if(h){const m=t.m.findTypeMetadata(h,F);if(m){const K=m.typeFunction?m.typeFunction({newObject:f,object:n,property:F}):m.reflectedType;m.options&&m.options.discriminator&&m.options.discriminator.property&&m.options.discriminator.subTypes?n[U]instanceof Array?b=m:(this.transformationType===s.h.PLAIN_TO_CLASS&&(b=m.options.discriminator.subTypes.find(Q=>{if(O&&O instanceof Object&&m.options.discriminator.property in O)return Q.name===O[m.options.discriminator.property]}),b=void 0===b?K:b.value,m.options.keepDiscriminatorProperty||O&&O instanceof Object&&m.options.discriminator.property in O&&delete O[m.options.discriminator.property]),this.transformationType===s.h.CLASS_TO_CLASS&&(b=O.constructor),this.transformationType===s.h.CLASS_TO_PLAIN&&O&&(O[m.options.discriminator.property]=m.options.discriminator.subTypes.find(Q=>Q.value===O.constructor).name)):b=K,k=k||m.reflectedType===Map}else if(this.options.targetMaps)this.options.targetMaps.filter(C=>C.target===h&&!!C.properties[F]).forEach(C=>b=C.properties[F]);else if(this.options.enableImplicitConversion&&this.transformationType===s.h.PLAIN_TO_CLASS){const C=Reflect.getMetadata("design:type",h.prototype,F);C&&(b=C)}}const G=Array.isArray(n[U])?this.getReflectedType(h,F):void 0,W=i?i[U]:void 0;if(f.constructor.prototype){const m=Object.getOwnPropertyDescriptor(f.constructor.prototype,M);if((this.transformationType===s.h.PLAIN_TO_CLASS||this.transformationType===s.h.CLASS_TO_CLASS)&&(m&&!m.set||f[M]instanceof Function))continue}if(this.options.enableCircularCheck&&this.isCircular(O)){if(this.transformationType===s.h.CLASS_TO_CLASS){let m=O;m=this.applyCustomTransformations(m,h,S,n,this.transformationType),(void 0!==m||this.options.exposeUnsetFields)&&(f instanceof Map?f.set(M,m):f[M]=m)}}else{const m=this.transformationType===s.h.PLAIN_TO_CLASS?M:S;let C;this.transformationType===s.h.CLASS_TO_PLAIN?(C=n[m],C=this.applyCustomTransformations(C,h,m,n,this.transformationType),C=n[m]===C?O:C,C=this.transform(W,C,b,G,k,v+1)):void 0===O&&this.options.exposeDefaultValues?C=f[M]:(C=this.transform(W,O,b,G,k,v+1),C=this.applyCustomTransformations(C,h,m,n,this.transformationType)),(void 0!==C||this.options.exposeUnsetFields)&&(f instanceof Map?f.set(M,C):f[M]=C)}}return this.options.enableCircularCheck&&this.recursionStack.delete(n),f}return n}applyCustomTransformations(i,n,h,A,_){let v=t.m.findTransformMetadatas(n,h,this.transformationType);return void 0!==this.options.version&&(v=v.filter(y=>!y.options||this.checkVersion(y.options.since,y.options.until))),v=v.filter(this.options.groups&&this.options.groups.length?y=>!y.options||this.checkGroups(y.options.groups):y=>!y.options||!y.options.groups||!y.options.groups.length),v.forEach(y=>{i=y.transformFn({value:i,key:h,obj:A,type:_,options:this.options})}),i}isCircular(i){return this.recursionStack.has(i)}getReflectedType(i,n){if(!i)return;const h=t.m.findTypeMetadata(i,n);return h?h.reflectedType:void 0}getKeys(i,n,h){let A=t.m.getStrategy(i);"none"===A&&(A=this.options.strategy||"exposeAll");let _=[];if(("exposeAll"===A||h)&&(_=n instanceof Map?Array.from(n.keys()):Object.keys(n)),h)return _;if(this.options.ignoreDecorators&&this.options.excludeExtraneousValues&&i&&(_=[...t.m.getExposedProperties(i,this.transformationType),...t.m.getExcludedProperties(i,this.transformationType)]),!this.options.ignoreDecorators&&i){let v=t.m.getExposedProperties(i,this.transformationType);this.transformationType===s.h.PLAIN_TO_CLASS&&(v=v.map(f=>{const S=t.m.findExposeMetadata(i,f);return S&&S.options&&S.options.name?S.options.name:f})),_=this.options.excludeExtraneousValues?v:_.concat(v);const y=t.m.getExcludedProperties(i,this.transformationType);y.length>0&&(_=_.filter(f=>!y.includes(f))),void 0!==this.options.version&&(_=_.filter(f=>{const S=t.m.findExposeMetadata(i,f);return!S||!S.options||this.checkVersion(S.options.since,S.options.until)})),_=_.filter(this.options.groups&&this.options.groups.length?f=>{const S=t.m.findExposeMetadata(i,f);return!S||!S.options||this.checkGroups(S.options.groups)}:f=>{const S=t.m.findExposeMetadata(i,f);return!(S&&S.options&&S.options.groups&&S.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(_=_.filter(v=>this.options.excludePrefixes.every(y=>v.substr(0,y.length)!==y))),_=_.filter((v,y,f)=>f.indexOf(v)===y),_}checkVersion(i,n){let h=!0;return h&&i&&(h=this.options.version>=i),h&&n&&(h=this.options.version<n),h}checkGroups(i){return!i||this.options.groups.some(n=>i.includes(n))}}const u={enableCircularCheck:!1,enableImplicitConversion:!1,excludeExtraneousValues:!1,excludePrefixes:void 0,exposeDefaultValues:!1,exposeUnsetFields:!0,groups:void 0,ignoreDecorators:!1,strategy:void 0,targetMaps:void 0,version:void 0},p=new class g{instanceToPlain(i,n){return new o(s.h.CLASS_TO_PLAIN,{...u,...n}).transform(void 0,i,void 0,void 0,void 0,void 0)}classToPlainFromExist(i,n,h){return new o(s.h.CLASS_TO_PLAIN,{...u,...h}).transform(n,i,void 0,void 0,void 0,void 0)}plainToInstance(i,n,h){return new o(s.h.PLAIN_TO_CLASS,{...u,...h}).transform(void 0,n,i,void 0,void 0,void 0)}plainToClassFromExist(i,n,h){return new o(s.h.PLAIN_TO_CLASS,{...u,...h}).transform(i,n,void 0,void 0,void 0,void 0)}instanceToInstance(i,n){return new o(s.h.CLASS_TO_CLASS,{...u,...n}).transform(void 0,i,void 0,void 0,void 0,void 0)}classToClassFromExist(i,n,h){return new o(s.h.CLASS_TO_CLASS,{...u,...h}).transform(n,i,void 0,void 0,void 0,void 0)}serialize(i,n){return JSON.stringify(this.instanceToPlain(i,n))}deserialize(i,n,h){const A=JSON.parse(n);return this.plainToInstance(i,A,h)}deserializeArray(i,n,h){const A=JSON.parse(n);return this.plainToInstance(i,A,h)}};function B(c,i,n){return p.plainToInstance(c,i,n)}function w(c,i,n){return p.plainToInstance(c,i,n)}},31061:(T,P,d)=>{d.d(P,{m:()=>a});var t=d(91415);const a=new class s{constructor(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}addTypeMetadata(l){this._typeMetadatas.has(l.target)||this._typeMetadatas.set(l.target,new Map),this._typeMetadatas.get(l.target).set(l.propertyName,l)}addTransformMetadata(l){this._transformMetadatas.has(l.target)||this._transformMetadatas.set(l.target,new Map),this._transformMetadatas.get(l.target).has(l.propertyName)||this._transformMetadatas.get(l.target).set(l.propertyName,[]),this._transformMetadatas.get(l.target).get(l.propertyName).push(l)}addExposeMetadata(l){this._exposeMetadatas.has(l.target)||this._exposeMetadatas.set(l.target,new Map),this._exposeMetadatas.get(l.target).set(l.propertyName,l)}addExcludeMetadata(l){this._excludeMetadatas.has(l.target)||this._excludeMetadatas.set(l.target,new Map),this._excludeMetadatas.get(l.target).set(l.propertyName,l)}findTransformMetadatas(l,o,u){return this.findMetadatas(this._transformMetadatas,l,o).filter(g=>!g.options||!0===g.options.toClassOnly&&!0===g.options.toPlainOnly||(!0===g.options.toClassOnly?u===t.h.CLASS_TO_CLASS||u===t.h.PLAIN_TO_CLASS:!0!==g.options.toPlainOnly||u===t.h.CLASS_TO_PLAIN))}findExcludeMetadata(l,o){return this.findMetadata(this._excludeMetadatas,l,o)}findExposeMetadata(l,o){return this.findMetadata(this._exposeMetadatas,l,o)}findExposeMetadataByCustomName(l,o){return this.getExposedMetadatas(l).find(u=>u.options&&u.options.name===o)}findTypeMetadata(l,o){return this.findMetadata(this._typeMetadatas,l,o)}getStrategy(l){const o=this._excludeMetadatas.get(l),u=o&&o.get(void 0),g=this._exposeMetadatas.get(l),p=g&&g.get(void 0);return u&&p||!u&&!p?"none":u?"excludeAll":"exposeAll"}getExposedMetadatas(l){return this.getMetadata(this._exposeMetadatas,l)}getExcludedMetadatas(l){return this.getMetadata(this._excludeMetadatas,l)}getExposedProperties(l,o){return this.getExposedMetadatas(l).filter(u=>!u.options||!0===u.options.toClassOnly&&!0===u.options.toPlainOnly||(!0===u.options.toClassOnly?o===t.h.CLASS_TO_CLASS||o===t.h.PLAIN_TO_CLASS:!0!==u.options.toPlainOnly||o===t.h.CLASS_TO_PLAIN)).map(u=>u.propertyName)}getExcludedProperties(l,o){return this.getExcludedMetadatas(l).filter(u=>!u.options||!0===u.options.toClassOnly&&!0===u.options.toPlainOnly||(!0===u.options.toClassOnly?o===t.h.CLASS_TO_CLASS||o===t.h.PLAIN_TO_CLASS:!0!==u.options.toPlainOnly||o===t.h.CLASS_TO_PLAIN)).map(u=>u.propertyName)}clear(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()}getMetadata(l,o){const u=l.get(o);let g;u&&(g=Array.from(u.values()).filter(e=>void 0!==e.propertyName));const p=[];for(const e of this.getAncestors(o)){const E=l.get(e);if(E){const x=Array.from(E.values()).filter(B=>void 0!==B.propertyName);p.push(...x)}}return p.concat(g||[])}findMetadata(l,o,u){const g=l.get(o);if(g){const p=g.get(u);if(p)return p}for(const p of this.getAncestors(o)){const e=l.get(p);if(e){const E=e.get(u);if(E)return E}}}findMetadatas(l,o,u){const g=l.get(o);let p;g&&(p=g.get(u));const e=[];for(const E of this.getAncestors(o)){const x=l.get(E);x&&x.has(u)&&e.push(...x.get(u))}return e.slice().reverse().concat((p||[]).slice().reverse())}getAncestors(l){if(!l)return[];if(!this._ancestorsMap.has(l)){const o=[];for(let u=Object.getPrototypeOf(l.prototype.constructor);typeof u.prototype<"u";u=Object.getPrototypeOf(u.prototype.constructor))o.push(u);this._ancestorsMap.set(l,o)}return this._ancestorsMap.get(l)}}}}]);
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[3337],{63385:(T,P,d)=>{d.d(P,{$:()=>t});var t=(()=>{return(s=t||(t={}))[s.DealPOS=1]="DealPOS",s[s.Tada=2]="Tada",t;var s})()},71378:(T,P,d)=>{d.d(P,{q:()=>t});var t=(()=>{return(s=t||(t={}))[s.Park=1]="Park",s[s.Payment=3]="Payment",s[s.Bill=2]="Bill",t;var s})()},77890:(T,P,d)=>{d.d(P,{_:()=>t});var t=(()=>{return(s=t||(t={}))[s.CashAndPoint=0]="CashAndPoint",s[s.Cash=1]="Cash",s[s.Point=2]="Point",t;var s})()},16571:(T,P,d)=>{d.d(P,{J:()=>t});var t=(()=>{return(s=t||(t={}))[s.Any=0]="Any",s[s.Standard=1]="Standard",s[s.NonInventory=2]="NonInventory",s[s.Composite=3]="Composite",s[s.Serialized=4]="Serialized",s[s.Manufactured=5]="Manufactured",s[s.Complementary=6]="Complementary",s[s.MultipleUOM=7]="MultipleUOM",s[s.PrepaidPoint=8]="PrepaidPoint",s[s.PrepaidPackage=10]="PrepaidPackage",t;var s})()},63631:(T,P,d)=>{d.d(P,{m:()=>a});var t=d(81180),s=d(67327);class a{constructor(){(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"Number",void 0),(0,t.Z)(this,"Due",void 0),(0,t.Z)(this,"Date",void 0),(0,t.Z)(this,"CustomDateField",void 0),(0,t.Z)(this,"TimeCustom",void 0),(0,t.Z)(this,"DateCustom",void 0),(0,t.Z)(this,"SurchargePcg",void 0),(0,t.Z)(this,"TempSurchargePcg",void 0),(0,t.Z)(this,"ToP",void 0),(0,t.Z)(this,"Note",void 0),(0,t.Z)(this,"ReferenceInvoiceID",void 0),(0,t.Z)(this,"PaymentStateID",void 0),(0,t.Z)(this,"Sales",void 0),this.ID=s.gT.GuidEmpty,this.SurchargePcg=0,this.TempSurchargePcg=0}}},52029:(T,P,d)=>{d.d(P,{Q:()=>s});var t=d(81180);class s{constructor(){(0,t.Z)(this,"Name",void 0),(0,t.Z)(this,"Phone",void 0),(0,t.Z)(this,"Address",void 0),(0,t.Z)(this,"City",void 0),this.Name="",this.Phone="",this.Address="",this.City=""}}},42763:(T,P,d)=>{d.d(P,{N:()=>D});var t=d(81180),s=d(16571),a=d(67327);class D{get Total(){const o=this.GrossTotal-this.DiscountPercentAmount;return this.validateDiscountAmount(o),o-this.DiscountAmount*this.Quantity}validateDiscountAmount(o){o>0&&this.DiscountAmount>o&&(this.DiscountAmount=o)}get GrossTotal(){return this.Price*(this.Quantity*this.UnitQuantity)||0}get DiscountPercentAmount(){return this.Discount?this.GrossTotal*this.Discount/100:0}constructor(){(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"VariantID",void 0),(0,t.Z)(this,"Quantity",void 0),(0,t.Z)(this,"Cost",void 0),(0,t.Z)(this,"Price",void 0),(0,t.Z)(this,"Expense",void 0),(0,t.Z)(this,"UnitPriceOriginal",void 0),(0,t.Z)(this,"Discount",void 0),(0,t.Z)(this,"DiscountAmount",void 0),(0,t.Z)(this,"Note",void 0),(0,t.Z)(this,"Taxable",void 0),(0,t.Z)(this,"LoyaltyPoint",void 0),(0,t.Z)(this,"EntityID",void 0),(0,t.Z)(this,"UnitQuantity",void 0),(0,t.Z)(this,"VariantUnitQuantity",void 0),(0,t.Z)(this,"UnitQuantityPrice",void 0),(0,t.Z)(this,"PriceTypeID",void 0),(0,t.Z)(this,"PriceNote",void 0),(0,t.Z)(this,"Index",void 0),(0,t.Z)(this,"Splited",void 0),(0,t.Z)(this,"InventoryTypeID",void 0),(0,t.Z)(this,"TypeID",void 0),(0,t.Z)(this,"Variant",void 0),(0,t.Z)(this,"EntityName",void 0),(0,t.Z)(this,"SalesID",void 0),(0,t.Z)(this,"SalesName",void 0),(0,t.Z)(this,"PriceBookID",void 0),(0,t.Z)(this,"Serial",void 0),(0,t.Z)(this,"UnitExpense",void 0),(0,t.Z)(this,"UnitCost",void 0),(0,t.Z)(this,"UnitPrice",void 0),(0,t.Z)(this,"Checked",void 0),(0,t.Z)(this,"SplitQuantity",void 0),(0,t.Z)(this,"PurchaseOrderID",void 0),(0,t.Z)(this,"isMaxInventory",void 0),(0,t.Z)(this,"SerialSource",void 0),(0,t.Z)(this,"isCopyPromotionName",void 0),(0,t.Z)(this,"isCopyProdDesc",void 0),this.EntityID=a.gT.GuidEmpty,this.ID=a.gT.GuidEmpty,this.Note="",this.SplitQuantity=0,this.SalesID="",this.Quantity=1}patchByVariant(o,u,g){this.PriceTypeID=o.PriceTypeID,this.Variant=o,this.VariantID=o.ID,this.isCopyPromotionName=g,this.isCopyProdDesc=this.isCopyProdDesc=u,this.setItemNote(o),this.UnitQuantity=o.UnitQuantity,o.UnitQuantity>1&&(this.UnitQuantityPrice=this.Variant.UnitPrice/this.Variant.UnitQuantity),this.Price=o.UnitPrice,this.UnitPrice=o.UnitPrice,this.Cost=o.UnitCost,this.UnitCost=o.UnitCost,this.Expense=o.UnitCost,this.Discount=o.PriceDiscount,this.UnitPriceOriginal=o.UnitPriceOriginal,this.DiscountAmount=0,this.Taxable=o.Taxable,this.InventoryTypeID=o.TypeID,this.LoyaltyPoint=o.LoyaltyPoint,this.VariantUnitQuantity=o.VariantUnitQuantity,this.SalesID="",this.setByVariantType(o),this.setItemNote(o)}setByVariantType(o){switch(o.TypeID){case s.J.NonInventory:o.Config&&(this.Cost=this.Total/this.Quantity);break;case s.J.Serialized:this.Serial=o.Serial}}setItemNote(o){o.TypeID!=s.J.Serialized&&(this.isCopyProdDesc&&(this.Note=o.Description),this.isCopyPromotionName&&a.gT.IsNotEmpty(o.PriceNote)&&(this.Note=a.gT.IsNotEmpty(o.PriceNote)?o.PriceNote:this.Note))}pricebookUpdate(o,u,g){if(this.PriceBookID&&u){const e=this.getSelectedPricebook(this.PriceBookID);a.gT.IsNotEmpty(this.Note)&&a.gT.IsNotEmpty(e)&&this.Note.replace(e.Name,"")}this.PriceBookID=o;const p=this.getSelectedPricebook(o);p?(this.Price=p.UnitPrice,this.Discount=p.PriceDiscount,this.Cost=null==p.UnitCost?this.Variant.UnitCost:p.UnitCost,this.PriceTypeID=2,g&&(this.Note=p.Name),this.PriceNote=p.Name):(this.Price=this.Variant.UnitPrice,this.Discount=this.Variant.PriceDiscount,this.Cost=this.Variant.UnitCost,this.PriceTypeID=0,this.setItemNote(this.Variant))}getPricebookByQuantity(){let o=0,u=null;return this.Variant.PriceBook&&this.Variant.PriceBook.length>0&&this.Variant.PriceBook.filter(p=>p.MinimumQuantity<=this.Quantity).forEach(p=>{o<=p.MinimumQuantity&&p.MinimumQuantity>0&&(u=p.ID,o=p.MinimumQuantity)}),u}updatePriceStatus(o){if(this.Price!=this.Variant.UnitPrice){const u=this.getSelectedPricebook(o);u&&u.UnitPrice==this.Price?(this.PriceTypeID=2,this.PriceNote=u.Name):this.PriceTypeID=1}}getSelectedPricebook(o){if(this.Variant.PriceBook){const u=this.Variant.PriceBook.filter(g=>g.ID==o);if(u.length)return u[0]}return null}checkMatchSerialWithQuantity(){let o=!0;return this.isSerialType()&&this.Quantity!==this.calculateSerialQty()&&(o=!1),o}calculateSerialQty(){let o=0;return this.Serial&&this.Serial.forEach(u=>{o+=u.Quantity}),o}isSerialType(){let o=!1;return this.Variant?.TypeID===s.J.Serialized&&(o=!0),o}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}}},94768:(T,P,d)=>{d.d(P,{t:()=>a});var t=d(81180),s=d(42763);class a extends s.N{constructor(){super(),(0,t.Z)(this,"Variants",void 0),(0,t.Z)(this,"PromotionGift",void 0),(0,t.Z)(this,"TotalWithoutDiscount",void 0),this.PromotionGift=!1,this.isMaxInventory=!1}}},23389:(T,P,d)=>{d.d(P,{j:()=>s});var t=d(81180);class s{constructor(D,l,o,u){(0,t.Z)(this,"MethodID",void 0),(0,t.Z)(this,"Amount",0),(0,t.Z)(this,"Note",void 0),(0,t.Z)(this,"Index",void 0),(0,t.Z)(this,"Date",void 0),(0,t.Z)(this,"PaidAmount",void 0),(0,t.Z)(this,"Code",void 0),(0,t.Z)(this,"MethodName",void 0),(0,t.Z)(this,"InvoiceID",void 0),(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"TypeID",void 0),this.MethodID=D||0,this.Amount=l||0,this.PaidAmount=o||0,this.Date=u instanceof Date?u.toDateString():u}}},75033:(T,P,d)=>{d.d(P,{m:()=>L});var t=d(81180),s=d(70655),a=d(63631),D=d(67327),l=(()=>{return(I=l||(l={}))[I.Unsent=1]="Unsent",I[I.Partial=2]="Partial",I[I.Sent=3]="Sent",l;var I})(),o=d(63385);class u{constructor(){(0,t.Z)(this,"ID",void 0),(0,t.Z)(this,"EntityID",void 0),(0,t.Z)(this,"RegisterID",void 0),(0,t.Z)(this,"TypeID",void 0),(0,t.Z)(this,"Date",void 0),(0,t.Z)(this,"Number",void 0),(0,t.Z)(this,"CustomerID",void 0),(0,t.Z)(this,"SalesID",void 0),(0,t.Z)(this,"Discount",0),(0,t.Z)(this,"Discount2",0),(0,t.Z)(this,"DiscountAmount",0),(0,t.Z)(this,"Note",""),(0,t.Z)(this,"DeliveryOutletID",void 0),(0,t.Z)(this,"TaxTypeID",void 0),(0,t.Z)(this,"CurrencyID",void 0),(0,t.Z)(this,"CurrencyRate",void 0),(0,t.Z)(this,"PointUsed",void 0),(0,t.Z)(this,"InvoicedStateID",void 0),(0,t.Z)(this,"ReferenceNumber",""),(0,t.Z)(this,"LogisticsServiceID",void 0),(0,t.Z)(this,"ParkLabel",""),(0,t.Z)(this,"NumberOfPerson",void 0),(0,t.Z)(this,"ClientTimestamp",void 0),(0,t.Z)(this,"Created",void 0),(0,t.Z)(this,"AuthorizationKey",""),(0,t.Z)(this,"CouponType",o.$.DealPOS),(0,t.Z)(this,"AuthorizationNote",""),(0,t.Z)(this,"DeliveryStateID",void 0),(0,t.Z)(this,"Att",""),this.ID=D.gT.GuidEmpty,this.EntityID=D.gT.GuidEmpty,this.RegisterID=D.gT.GuidEmpty,this.Number="",this.CustomerID=null,this.SalesID=null,this.Discount=0,this.Discount2=0,this.DiscountAmount=0,this.Note="",this.TaxTypeID=D.gT.GuidEmpty,this.CurrencyID=1,this.CurrencyRate=1,this.DeliveryStateID=l.Unsent,this.PointUsed=0,this.NumberOfPerson=1,this.Date=(new Date).toJSON(),this.Att=""}removeEnterNote(){this.Note&&(this.Note=this.Note.replace(/\n/g,""))}}var g=d(23389),p=d(52029),e=d(71378);class E{constructor(){(0,t.Z)(this,"DeliveryEntityID",void 0),(0,t.Z)(this,"Type",void 0),(0,t.Z)(this,"Retur",void 0),(0,t.Z)(this,"NewOrderID",void 0),this.DeliveryEntityID="",this.Type=e.q.Payment,this.Retur=!1}}var x=d(94768),B=d(42763),w=d(77890),R=d(16571),N=d(43429);class L{get cartQuantity(){let Z=0;for(let r of this.CartItems)Z+=r.Quantity;return Z}constructor(){(0,t.Z)(this,"Order",void 0),(0,t.Z)(this,"Invoice",void 0),(0,t.Z)(this,"Shipping",void 0),(0,t.Z)(this,"Action",void 0),(0,t.Z)(this,"Payments",void 0),(0,t.Z)(this,"Items",void 0),(0,t.Z)(this,"CartItems",void 0),(0,t.Z)(this,"ContactName",void 0),(0,t.Z)(this,"LocalParkID",void 0),(0,t.Z)(this,"Message",void 0),this.Order=new u,this.Invoice=new a.m,this.Shipping=new p.Q,this.Action=new E,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}emptyCart(){this.Items=[]}isCartEmpty(){return 0==this.Items.length}get TotalPaidAmount(){let Z=0;return this.Payments.forEach(r=>{Z+=r.PaidAmount}),Z}get RedeemableAmount(){let Z=this.CartItems.filter(r=>r.Variant.PaymentTypeID!=w._.Cash);return this.GetAmountByCart(Z)}get TotalQuantity(){let Z=0;return this.CartItems.forEach(r=>{r.PromotionGift||(Z+=r.Quantity)}),Z}get CashOnlyAmount(){let Z=this.CartItems.filter(r=>r.Variant.PaymentTypeID==w._.Cash);return this.GetAmountByCart(Z)}get PointOnlyAmount(){let Z=this.CartItems.filter(r=>r.Variant.PaymentTypeID==w._.Point);return this.GetAmountByCart(Z)}get PrepaidPackageItem(){return this.CartItems.filter(r=>r.Variant.TypeID==R.J.PrepaidPackage)}GetAmountByCart(Z){let r=0;return Z.forEach(c=>{r+=c.Total}),r=r*(100-this.Order.Discount)/100,r=r*(100-this.Order.Discount2)/100,r}}(0,s.gn)([(0,N.D)(()=>u)],L.prototype,"Order",void 0),(0,s.gn)([(0,N.D)(()=>a.m)],L.prototype,"Invoice",void 0),(0,s.gn)([(0,N.D)(()=>p.Q)],L.prototype,"Shipping",void 0),(0,s.gn)([(0,N.D)(()=>E)],L.prototype,"Action",void 0),(0,s.gn)([(0,N.D)(()=>g.j)],L.prototype,"Payments",void 0),(0,s.gn)([(0,N.D)(()=>B.N)],L.prototype,"Items",void 0),(0,s.gn)([(0,N.D)(()=>x.t)],L.prototype,"CartItems",void 0)},13337:(T,P,d)=>{d.d(P,{T:()=>L});var t=d(81180),s=d(88996),a=d(75033),D=d(50494),l=d(54004),o=d(63900),u=d(39300),g=d(24351),p=d(70262),e=d(907),E=d(29990),x=d(94650),B=d(58966),w=d(89156),R=d(85421),N=d(97185);let L=(()=>{class I{constructor(r,c,i,n){(0,t.Z)(this,"httpService",void 0),(0,t.Z)(this,"dbService",void 0),(0,t.Z)(this,"toastrService",void 0),this.httpService=c,this.dbService=i,this.toastrService=n}get hasConnection(){return navigator.onLine}isProductFromServer(){return this.getOfflineConfig().pipe((0,l.U)(r=>null==r||!r.productUsingLocal&&this.hasConnection))}isConfigFromServer(){return this.getOfflineConfig().pipe((0,l.U)(r=>!r.configUsingLocal&&this.hasConnection))}isStoreOrderInServer(){return this.getOfflineConfig().pipe((0,l.U)(r=>null==r||!r.orderUsingLocal&&this.hasConnection))}getPOSStorage(){return this.dbService.getByID(e.Z.POSStorage,1)}syncPOSStorage(r){return r.id=1,this.dbService.getByID(e.Z.POSStorage,1).pipe((0,o.w)(c=>null==c?this.dbService.add(e.Z.POSStorage,r):this.dbService.update(e.Z.POSStorage,r)),(0,l.U)(c=>r))}syncOrder(r){return this.dbService.add(e.Z.Order,r)}findAllOrders(){return this.dbService.getAll(e.Z.Order)}uploadOrders(){return this.findAllOrders().pipe((0,u.h)(r=>r.length>0),(0,g.b)(r=>(0,s.D)(r).pipe((0,g.b)(i=>this.uploadOrderProcess(i)))))}uploadOrderProcess(r){let c=r.Order.Number,i=this.createOrderForSubmission(r);return this.httpService.post("/API/POS/SubmitOrder",i).pipe((0,o.w)(n=>n.Success?(this.toastrService.success(`Order with number ${c} synchronized to server`,"Success"),this.removeOrder(r.id)):(this.toastrService.error(`Failed to upload order with number ${c}`,"Error!"),this.syncFailedOrder(r).pipe((0,l.U)(h=>!1)))),(0,p.K)(n=>(this.toastrService.error(`Failed to upload order with number ${c}`,"Error!"),this.syncFailedOrder(r).pipe((0,l.U)(h=>!1)))))}removeOrder(r){return this.dbService.deleteByKey(e.Z.Order,r)}createOrderForSubmission(r){let c=Object.assign({},r);return delete c.CartItems,delete c.Message,c}syncFailedOrder(r){const c=(0,D.d8)(a.m,r);return this.dbService.add(e.Z.FailedOrder,c).pipe((0,o.w)(i=>this.removeOrder(r.id)))}uploadFailedOrder(r){let c=this.createOrderForSubmission(r);return this.httpService.post("/API/POS/SubmitOrder",c).pipe((0,o.w)(()=>this.removeFailedOrder(r.id)))}getFailedOrders(){return this.dbService.getAll(e.Z.FailedOrder)}removeFailedOrder(r){return this.dbService.deleteByKey(e.Z.FailedOrder,r)}syncVariants(r){return this.dbService.getAll(e.Z.Product).pipe((0,o.w)(c=>0==c.length?this.dbService.bulkAdd(e.Z.Product,r):this.dbService.clear(e.Z.Product).pipe((0,o.w)(i=>{if(i)return this.dbService.bulkAdd(e.Z.Product,r)}))))}findAllVariant(){return this.dbService.getAll(e.Z.Product)}findVariantById(r){return this.dbService.getByID(e.Z.Product,r).pipe((0,u.h)(c=>this.warningNotFound(c,E.g.failGetLocalVariant)),(0,o.w)(c=>this.findOutletPriceVariant(c)))}findVariantByCode(r){return this.dbService.getByIndex(e.Z.Product,"Code",r).pipe((0,u.h)(c=>this.warningNotFound(c,E.g.failGetLocalVariant)),(0,o.w)(c=>this.findOutletPriceVariant(c)))}findOutletPriceVariant(r){return this.dbService.getByIndex(e.Z.OutletPrice,"VariantID",r.ID).pipe((0,l.U)(c=>(c&&(r.UnitPrice=c.UnitPrice,r.PriceDiscount=c.PriceDiscount),r)))}warningNotFound(r,c){return!!r||(this.toastrService.warning(c,"Warning"),!1)}syncOutletPrice(r){return this.dbService.getAll(e.Z.OutletPrice).pipe((0,o.w)(c=>0==c.length?this.dbService.bulkAdd(e.Z.OutletPrice,r):this.dbService.clear(e.Z.OutletPrice).pipe((0,o.w)(i=>{if(i)return this.dbService.bulkAdd(e.Z.OutletPrice,r)}))))}findAllOutletPrices(){return this.dbService.getAll(e.Z.OutletPrice)}syncRegisters(r){return this.dbService.getAll(e.Z.Outlet).pipe((0,o.w)(c=>0==c.length?this.dbService.bulkAdd(e.Z.Outlet,r):this.dbService.clear(e.Z.Outlet).pipe((0,o.w)(i=>{if(i)return this.dbService.bulkAdd(e.Z.Outlet,r)}))))}findRegisterByID(r){return this.dbService.getByID(e.Z.Outlet,r)}findAllRegister(){return this.dbService.getAll(e.Z.Outlet)}getSyncTime(){return this.dbService.getByID(e.Z.SyncTime,1)}updateSyncTime(){return this.dbService.getByID(e.Z.SyncTime,1).pipe((0,o.w)(r=>{const c={id:1,time:(new Date).toString()};return r?this.dbService.update(e.Z.SyncTime,c):this.dbService.add(e.Z.SyncTime,c)}))}updateOfflineConfig(r){let c={id:1,configUsingLocal:r.configUsingLocal,orderUsingLocal:r.orderUsingLocal,productUsingLocal:r.productUsingLocal};return this.dbService.getByID(e.Z.OfflineConfig,1).pipe((0,o.w)(i=>null==i?this.dbService.add(e.Z.OfflineConfig,c):this.dbService.update(e.Z.OfflineConfig,c)))}getOfflineConfig(){return this.dbService.getByID(e.Z.OfflineConfig,1)}}return(0,t.Z)(I,"\u0275fac",function(r){return new(r||I)(x.LFG(B.X),x.LFG(w.O),x.LFG(R.ys),x.LFG(N._W))}),(0,t.Z)(I,"\u0275prov",x.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"})),I})()},29990:(T,P,d)=>{d.d(P,{g:()=>s});var t=d(81180);let s=(()=>{class a{}return(0,t.Z)(a,"emptyDate","Please fill invoice date"),(0,t.Z)(a,"emptyNumber","Please fill invoice number"),(0,t.Z)(a,"emptyOrderNumber","Number is Required"),(0,t.Z)(a,"failGetMenu","Fail to get pos menu"),(0,t.Z)(a,"failToGetRetur","Fail to get retur"),(0,t.Z)(a,"failGetLocalPosStorage","Fail to get setting and option from local storage, Please re-cache your data while online!"),(0,t.Z)(a,"failGetVariant",'"Error getting variant with {0} {1}" - {2}'),(0,t.Z)(a,"failGetLocalVariant","Fail to get variant from local storage, Please re-cache your data while online!"),(0,t.Z)(a,"emptyBarcodeFormat",'No product with barcode "{0}"'),(0,t.Z)(a,"emptyCustomerFormat",'No customer with code "{0}"'),(0,t.Z)(a,"failGetSalesOrder","Fail to get sales order"),(0,t.Z)(a,"failBin","Fail to bin transaction"),(0,t.Z)(a,"failGetCustomer","Fail to get customer's data"),(0,t.Z)(a,"failCreateCustomer","Fail to create customer"),(0,t.Z)(a,"noRoleContact","You have no right to create new customer"),(0,t.Z)(a,"submitLocally","Connection unavailable ~ offline! Order stored locally"),(0,t.Z)(a,"OfflineOrderNotSupport","Offline order is not Supported!"),(0,t.Z)(a,"failOrderConnectionTimeOut","Connection timeout! Please try uploading your order again!"),(0,t.Z)(a,"failDeletePark","Fail to delete park"),(0,t.Z)(a,"emptyAccessRegister","You do not have access to any Register"),(0,t.Z)(a,"failGenerateNewNumber","Fail to generate new number"),(0,t.Z)(a,"emptyPayment","There is no active payment method."),(0,t.Z)(a,"failOpenRegister","Fail to open register"),(0,t.Z)(a,"failGetLocalOutletInfo","Fail to get outlet information from local storage, Please re-cache your data while online!"),(0,t.Z)(a,"failTrySubmit","[Error submitting order] \n{0}"),(0,t.Z)(a,"failTryCreateCustomer",'"[Error creating customer] \n"{0}'),(0,t.Z)(a,"createCustomerOffline","Create customer is not supported when the connection offline"),(0,t.Z)(a,"emptyCustomer","Please select customer!"),(0,t.Z)(a,"emptySalesPerson","Please select sales person!"),(0,t.Z)(a,"emptySalesType","Please select sales type!"),(0,t.Z)(a,"failCreateNewVariant","Fail to create new variant"),(0,t.Z)(a,"requiredDefaultCategory","[WARNING] - POS / Quick Create Product requires Default Category"),(0,t.Z)(a,"emptyVariant","Item is undefined, please re-type"),(0,t.Z)(a,"emptyPOItem","You must have at least one item"),(0,t.Z)(a,"emptyEntity","Please select entity before proceeding.."),(0,t.Z)(a,"failGetRetrieve","Fail to get retrieve"),(0,t.Z)(a,"failTryPark","[Error submitting park] \n{0}"),(0,t.Z)(a,"failTryGetPark","[Error during get park] \n{0}"),(0,t.Z)(a,"failTryGetOutStanding","[Error during get outstanding] \n{0}"),(0,t.Z)(a,"failTryGetParkSelect","[Error during get available park select] \n{0}"),(0,t.Z)(a,"failGetSerial","Fail to get variant serial"),(0,t.Z)(a,"successSendOrder","Orders synchronized to server. Upload Transaction Complete!"),(0,t.Z)(a,"successSyncProduct","Products synchronized to Local Storage"),(0,t.Z)(a,"failGetPark","Fail to get park"),(0,t.Z)(a,"failMergePark","Fail to merge park"),(0,t.Z)(a,"failGetOutStanding","Fail to get outstanding"),(0,t.Z)(a,"failGetParkSelect","Fail to get available park select"),(0,t.Z)(a,"confirmationDeleteOrder","Are you sure want to delete this order?"),(0,t.Z)(a,"confirmationCloseRegister","The Register is still occupied under '{0}'. Do you want to end his / her session?"),(0,t.Z)(a,"closeActiveRegister","You already have an active register with name '{0}'. Do you want to end your session?"),(0,t.Z)(a,"successSendEmail","Email is sent successfully to '{0}'"),(0,t.Z)(a,"wrongOfflineAction","This action is not supported when the connection offline"),(0,t.Z)(a,"emptyCustomerCredit","Credit Payment requires customer specified!"),(0,t.Z)(a,"debtLimit","Your debt is over limit!"),(0,t.Z)(a,"emptyCustomerDeposit","Deposit Payment requires customer specified!"),(0,t.Z)(a,"creditLock","You have no right to give credit!"),(0,t.Z)(a,"failToSyncProduct","Fail sync product to local storage!"),(0,t.Z)(a,"failToSyncOrder","Fail sync Order to local storage!"),(0,t.Z)(a,"emptyDeliveryOutlet","There is no outlet in delivery module."),(0,t.Z)(a,"wrongAuthorizationCode","Wrong Authorize Code!"),(0,t.Z)(a,"priceMinimumRestriction","You have no right to sell this item lower than {0}"),(0,t.Z)(a,"clearBrowsingData","A new version of our POS is available, please clear your browsing data to apply changes!"),(0,t.Z)(a,"offlineModeNotification","WARNING! Your point of sale configuration is set to LOCAL, orders are not synchronized automatically."),(0,t.Z)(a,"failServerConnection","Something happen to the server, switch query to local mode to continue work!"),(0,t.Z)(a,"taxEmpty","Tax options is empty, go to setup and add tax!"),(0,t.Z)(a,"clearCommission","Are you sure to leave this page without saving?"),(0,t.Z)(a,"voidConfirm","This will replace current order's item(s) with blank order."),(0,t.Z)(a,"notSellAble","This item is not for sell"),(0,t.Z)(a,"partialLoyaltyPointUnable","You only can fully pay with loyalty point, otherwise please remove the loyalty point and use other available payment options"),(0,t.Z)(a,"DiffDate","Client date is not equal with Server Date"),(0,t.Z)(a,"pointOnly","{0} need paid by point only"),(0,t.Z)(a,"cashOnly","{0} cannot paid by point"),(0,t.Z)(a,"ovoConfig","WARNING! Your ovo configuration is not set"),(0,t.Z)(a,"failGenerateQR","Failed to generate qr code"),(0,t.Z)(a,"failPaymentOvo","Failed to pay with ovo, Try again"),(0,t.Z)(a,"emptyPhone","Please Fill Phone"),(0,t.Z)(a,"maxInventory","Your Bought Qty will exceed the Max Inventory"),(0,t.Z)(a,"payNowOnly","You have no access to sell with Later Payment"),a})()},58966:(T,P,d)=>{d.d(P,{X:()=>Z});var t=d(81180),s=d(39646),a=d(60515),D=d(18505),l=d(63900),o=d(54004),u=d(70262),g=d(36895),p=d(65412),e=d(94650);function E(r,c){if(1&r&&e._UZ(0,"button",13),2&r){const i=e.oxw().index;e.uIk("data-bs-slide-to",i)}}function x(r,c){if(1&r&&(e.ynx(0),e.YNc(1,E,1,1,"button",12),e.BQk()),2&r){const i=c.index;e.xp6(1),e.Q6J("ngIf",0!=i)}}function B(r,c){if(1&r&&(e.TgZ(0,"div",10),e._UZ(1,"button",11),e.YNc(2,x,2,1,"ng-container",9),e.qZA()),2&r){const i=e.oxw();e.xp6(1),e.uIk("data-bs-slide-to",0),e.xp6(1),e.Q6J("ngForOf",i.changelogs)}}function w(r,c){if(1&r&&(e.TgZ(0,"div",15),e._UZ(1,"img",6),e.TgZ(2,"h2")(3,"a",7),e._uU(4),e.qZA()(),e.TgZ(5,"p",8),e._uU(6),e.qZA()()),2&r){const i=e.oxw().$implicit;e.xp6(1),e.Q6J("src",i.ImageSource,e.LSH),e.xp6(2),e.Q6J("href",i.Href,e.LSH),e.xp6(1),e.Oqu(i.Title),e.xp6(2),e.hij(" ",i.Description," ")}}function R(r,c){if(1&r&&(e.ynx(0),e.YNc(1,w,7,4,"div",14),e.BQk()),2&r){const i=c.index;e.xp6(1),e.Q6J("ngIf",0!=i)}}let N=(()=>{class r{constructor(i,n){(0,t.Z)(this,"dialogRef",void 0),(0,t.Z)(this,"changelogs",[]),this.dialogRef=n,this.changelogs=i}close(){this.dialogRef.close()}}return(0,t.Z)(r,"\u0275fac",function(i){return new(i||r)(e.Y36(p.WI),e.Y36(p.so))}),(0,t.Z)(r,"\u0275cmp",e.Xpm({type:r,selectors:[["POS-modal-changelog"]],standalone:!0,features:[e.jDz],decls:14,vars:6,consts:[[1,"changelog-container","h-100"],["mat-button","",1,"close",3,"click"],["id","carouselExampleIndicators","data-bs-ride","carousel",1,"carousel","slide"],["class","carousel-indicators",4,"ngIf"],[1,"carousel-inner"],[1,"carousel-item","active"],["alt","",3,"src"],["target","_blank",3,"href"],[1,"description"],[4,"ngFor","ngForOf"],[1,"carousel-indicators"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true",1,"active"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true",4,"ngIf"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true"],["class","carousel-item",4,"ngIf"],[1,"carousel-item"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(){return n.close()}),e._uU(2,"X"),e.qZA(),e.TgZ(3,"div",2),e.YNc(4,B,3,2,"div",3),e.TgZ(5,"div",4)(6,"div",5),e._UZ(7,"img",6),e.TgZ(8,"h2")(9,"a",7),e._uU(10),e.qZA()(),e.TgZ(11,"p",8),e._uU(12),e.qZA()(),e.YNc(13,R,2,1,"ng-container",9),e.qZA()()()),2&i&&(e.xp6(4),e.Q6J("ngIf",n.changelogs.length>1),e.xp6(3),e.Q6J("src",n.changelogs[0].ImageSource,e.LSH),e.xp6(2),e.Q6J("href",n.changelogs[0].Href,e.LSH),e.xp6(1),e.Oqu(n.changelogs[0].Title),e.xp6(2),e.hij(" ",n.changelogs[0].Description," "),e.xp6(1),e.Q6J("ngForOf",n.changelogs))},dependencies:[g.ez,g.sg,g.O5],styles:[".changelog-container[_ngcontent-%COMP%]{position:relative;text-align:center}.changelog-container[_ngcontent-%COMP%] .carousel.slide[_ngcontent-%COMP%]{height:100%}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] [data-bs-target][_ngcontent-%COMP%]{background-color:#dbdfea}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] .active[_ngcontent-%COMP%]{background-color:#19a7ce}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:10px;border:0}.changelog-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:425px;width:100%}.changelog-container[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:20px}.changelog-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:10px!important;margin-bottom:15px!important;max-width:700px;font-size:15px;margin:0 auto}.changelog-container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{position:absolute;top:0;right:0;transform:translate(100%,-100%);background:white;padding:8px 13px;min-width:auto;border:none;border-radius:119px}"]})),r})();var L=d(89156),I=d(11481);let Z=(()=>{class r{constructor(i,n,h){(0,t.Z)(this,"http",void 0),(0,t.Z)(this,"matDialog",void 0),(0,t.Z)(this,"title",void 0),(0,t.Z)(this,"menu$",void 0),this.http=i,this.matDialog=n,this.title=h}setMenu$(){const i=this.getCurrentFormattedRoute();this.menu$=this.http.get(`/API/Menu/${i}`).pipe((0,D.b)(n=>this.title.setTitle(n.T)),(0,l.w)(n=>{let h=(0,s.of)(n);if(n.U.length>0){localStorage.getItem("mapRouteOpenChangelogDialog")||localStorage.setItem("mapRouteOpenChangelogDialog",JSON.stringify([]));const A=JSON.parse(localStorage.getItem("mapRouteOpenChangelogDialog"));A.includes(i)||(A.push(i),localStorage.setItem("mapRouteOpenChangelogDialog",JSON.stringify(A)),h=this.matDialog.open(N,{panelClass:"changelog-dialog",data:n.U,height:"500px",width:"750px"}).afterOpened().pipe((0,o.U)(()=>n)))}return h}),(0,u.K)(()=>a.E))}getCurrentFormattedRoute(){try{let i=window.location.href;return i=i.split("menu/")[1],i=i.split(";")[0],i}catch(i){console.log(i)}}}return(0,t.Z)(r,"\u0275fac",function(i){return new(i||r)(e.LFG(L.O),e.LFG(p.uw),e.LFG(I.Dx))}),(0,t.Z)(r,"\u0275prov",e.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"})),r})()},43429:(T,P,d)=>{d.d(P,{D:()=>s});var t=d(31061);function s(a,D={}){return function(l,o){const u=Reflect.getMetadata("design:type",l,o);t.m.addTypeMetadata({target:l.constructor,propertyName:o,reflectedType:u,typeFunction:a,options:D})}}},91415:(T,P,d)=>{d.d(P,{h:()=>t});var t=(()=>{return(s=t||(t={}))[s.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",s[s.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",s[s.CLASS_TO_CLASS=2]="CLASS_TO_CLASS",t;var s})()},50494:(T,P,d)=>{d.d(P,{d8:()=>B,yE:()=>w});var t=d(31061),s=d(91415);class o{constructor(i,n){this.transformationType=i,this.options=n,this.recursionStack=new Set}transform(i,n,h,A,_,v=0){if(Array.isArray(n)||n instanceof Set){const y=A&&this.transformationType===s.h.PLAIN_TO_CLASS?function l(c){const i=new c;return i instanceof Set||"push"in i?i:[]}(A):[];return n.forEach((f,S)=>{const U=i?i[S]:void 0;if(this.options.enableCircularCheck&&this.isCircular(f))this.transformationType===s.h.CLASS_TO_CLASS&&(y instanceof Set?y.add(f):y.push(f));else{let M;if("function"!=typeof h&&h&&h.options&&h.options.discriminator&&h.options.discriminator.property&&h.options.discriminator.subTypes){if(this.transformationType===s.h.PLAIN_TO_CLASS){M=h.options.discriminator.subTypes.find(k=>k.name===f[h.options.discriminator.property]);const b=h.typeFunction({newObject:y,object:f,property:void 0});M=void 0===M?b:M.value,h.options.keepDiscriminatorProperty||delete f[h.options.discriminator.property]}this.transformationType===s.h.CLASS_TO_CLASS&&(M=f.constructor),this.transformationType===s.h.CLASS_TO_PLAIN&&(f[h.options.discriminator.property]=h.options.discriminator.subTypes.find(O=>O.value===f.constructor).name)}else M=h;const F=this.transform(U,f,M,void 0,f instanceof Map,v+1);y instanceof Set?y.add(F):y.push(F)}}),y}if(h===String&&!_)return null==n?n:String(n);if(h===Number&&!_)return null==n?n:Number(n);if(h===Boolean&&!_)return null==n?n:Boolean(n);if((h===Date||n instanceof Date)&&!_)return n instanceof Date?new Date(n.valueOf()):null==n?n:new Date(n);if(function a(){return typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:void 0}().Buffer&&(h===Buffer||n instanceof Buffer)&&!_)return null==n?n:Buffer.from(n);if(function D(c){return null!==c&&"object"==typeof c&&"function"==typeof c.then}(n)&&!_)return new Promise((y,f)=>{n.then(S=>y(this.transform(void 0,S,h,void 0,void 0,v+1)),f)});if(!_&&null!==n&&"object"==typeof n&&"function"==typeof n.then)return n;if("object"==typeof n&&null!==n){!h&&n.constructor!==Object&&(!Array.isArray(n)&&n.constructor===Array||(h=n.constructor)),!h&&i&&(h=i.constructor),this.options.enableCircularCheck&&this.recursionStack.add(n);const y=this.getKeys(h,n,_);let f=i||{};!i&&(this.transformationType===s.h.PLAIN_TO_CLASS||this.transformationType===s.h.CLASS_TO_CLASS)&&(f=_?new Map:h?new h:{});for(const S of y){if("__proto__"===S||"constructor"===S)continue;const U=S;let O,M=S,F=S;if(!this.options.ignoreDecorators&&h)if(this.transformationType===s.h.PLAIN_TO_CLASS){const m=t.m.findExposeMetadataByCustomName(h,S);m&&(F=m.propertyName,M=m.propertyName)}else if(this.transformationType===s.h.CLASS_TO_PLAIN||this.transformationType===s.h.CLASS_TO_CLASS){const m=t.m.findExposeMetadata(h,S);m&&m.options&&m.options.name&&(M=m.options.name)}O=this.transformationType===s.h.PLAIN_TO_CLASS?n[U]:n instanceof Map?n.get(U):n[U]instanceof Function?n[U]():n[U];let b,k=O instanceof Map;if(h&&_)b=h;else if(h){const m=t.m.findTypeMetadata(h,F);if(m){const K=m.typeFunction?m.typeFunction({newObject:f,object:n,property:F}):m.reflectedType;m.options&&m.options.discriminator&&m.options.discriminator.property&&m.options.discriminator.subTypes?n[U]instanceof Array?b=m:(this.transformationType===s.h.PLAIN_TO_CLASS&&(b=m.options.discriminator.subTypes.find(Q=>{if(O&&O instanceof Object&&m.options.discriminator.property in O)return Q.name===O[m.options.discriminator.property]}),b=void 0===b?K:b.value,m.options.keepDiscriminatorProperty||O&&O instanceof Object&&m.options.discriminator.property in O&&delete O[m.options.discriminator.property]),this.transformationType===s.h.CLASS_TO_CLASS&&(b=O.constructor),this.transformationType===s.h.CLASS_TO_PLAIN&&O&&(O[m.options.discriminator.property]=m.options.discriminator.subTypes.find(Q=>Q.value===O.constructor).name)):b=K,k=k||m.reflectedType===Map}else if(this.options.targetMaps)this.options.targetMaps.filter(C=>C.target===h&&!!C.properties[F]).forEach(C=>b=C.properties[F]);else if(this.options.enableImplicitConversion&&this.transformationType===s.h.PLAIN_TO_CLASS){const C=Reflect.getMetadata("design:type",h.prototype,F);C&&(b=C)}}const G=Array.isArray(n[U])?this.getReflectedType(h,F):void 0,W=i?i[U]:void 0;if(f.constructor.prototype){const m=Object.getOwnPropertyDescriptor(f.constructor.prototype,M);if((this.transformationType===s.h.PLAIN_TO_CLASS||this.transformationType===s.h.CLASS_TO_CLASS)&&(m&&!m.set||f[M]instanceof Function))continue}if(this.options.enableCircularCheck&&this.isCircular(O)){if(this.transformationType===s.h.CLASS_TO_CLASS){let m=O;m=this.applyCustomTransformations(m,h,S,n,this.transformationType),(void 0!==m||this.options.exposeUnsetFields)&&(f instanceof Map?f.set(M,m):f[M]=m)}}else{const m=this.transformationType===s.h.PLAIN_TO_CLASS?M:S;let C;this.transformationType===s.h.CLASS_TO_PLAIN?(C=n[m],C=this.applyCustomTransformations(C,h,m,n,this.transformationType),C=n[m]===C?O:C,C=this.transform(W,C,b,G,k,v+1)):void 0===O&&this.options.exposeDefaultValues?C=f[M]:(C=this.transform(W,O,b,G,k,v+1),C=this.applyCustomTransformations(C,h,m,n,this.transformationType)),(void 0!==C||this.options.exposeUnsetFields)&&(f instanceof Map?f.set(M,C):f[M]=C)}}return this.options.enableCircularCheck&&this.recursionStack.delete(n),f}return n}applyCustomTransformations(i,n,h,A,_){let v=t.m.findTransformMetadatas(n,h,this.transformationType);return void 0!==this.options.version&&(v=v.filter(y=>!y.options||this.checkVersion(y.options.since,y.options.until))),v=v.filter(this.options.groups&&this.options.groups.length?y=>!y.options||this.checkGroups(y.options.groups):y=>!y.options||!y.options.groups||!y.options.groups.length),v.forEach(y=>{i=y.transformFn({value:i,key:h,obj:A,type:_,options:this.options})}),i}isCircular(i){return this.recursionStack.has(i)}getReflectedType(i,n){if(!i)return;const h=t.m.findTypeMetadata(i,n);return h?h.reflectedType:void 0}getKeys(i,n,h){let A=t.m.getStrategy(i);"none"===A&&(A=this.options.strategy||"exposeAll");let _=[];if(("exposeAll"===A||h)&&(_=n instanceof Map?Array.from(n.keys()):Object.keys(n)),h)return _;if(this.options.ignoreDecorators&&this.options.excludeExtraneousValues&&i&&(_=[...t.m.getExposedProperties(i,this.transformationType),...t.m.getExcludedProperties(i,this.transformationType)]),!this.options.ignoreDecorators&&i){let v=t.m.getExposedProperties(i,this.transformationType);this.transformationType===s.h.PLAIN_TO_CLASS&&(v=v.map(f=>{const S=t.m.findExposeMetadata(i,f);return S&&S.options&&S.options.name?S.options.name:f})),_=this.options.excludeExtraneousValues?v:_.concat(v);const y=t.m.getExcludedProperties(i,this.transformationType);y.length>0&&(_=_.filter(f=>!y.includes(f))),void 0!==this.options.version&&(_=_.filter(f=>{const S=t.m.findExposeMetadata(i,f);return!S||!S.options||this.checkVersion(S.options.since,S.options.until)})),_=_.filter(this.options.groups&&this.options.groups.length?f=>{const S=t.m.findExposeMetadata(i,f);return!S||!S.options||this.checkGroups(S.options.groups)}:f=>{const S=t.m.findExposeMetadata(i,f);return!(S&&S.options&&S.options.groups&&S.options.groups.length)})}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(_=_.filter(v=>this.options.excludePrefixes.every(y=>v.substr(0,y.length)!==y))),_=_.filter((v,y,f)=>f.indexOf(v)===y),_}checkVersion(i,n){let h=!0;return h&&i&&(h=this.options.version>=i),h&&n&&(h=this.options.version<n),h}checkGroups(i){return!i||this.options.groups.some(n=>i.includes(n))}}const u={enableCircularCheck:!1,enableImplicitConversion:!1,excludeExtraneousValues:!1,excludePrefixes:void 0,exposeDefaultValues:!1,exposeUnsetFields:!0,groups:void 0,ignoreDecorators:!1,strategy:void 0,targetMaps:void 0,version:void 0},p=new class g{instanceToPlain(i,n){return new o(s.h.CLASS_TO_PLAIN,{...u,...n}).transform(void 0,i,void 0,void 0,void 0,void 0)}classToPlainFromExist(i,n,h){return new o(s.h.CLASS_TO_PLAIN,{...u,...h}).transform(n,i,void 0,void 0,void 0,void 0)}plainToInstance(i,n,h){return new o(s.h.PLAIN_TO_CLASS,{...u,...h}).transform(void 0,n,i,void 0,void 0,void 0)}plainToClassFromExist(i,n,h){return new o(s.h.PLAIN_TO_CLASS,{...u,...h}).transform(i,n,void 0,void 0,void 0,void 0)}instanceToInstance(i,n){return new o(s.h.CLASS_TO_CLASS,{...u,...n}).transform(void 0,i,void 0,void 0,void 0,void 0)}classToClassFromExist(i,n,h){return new o(s.h.CLASS_TO_CLASS,{...u,...h}).transform(n,i,void 0,void 0,void 0,void 0)}serialize(i,n){return JSON.stringify(this.instanceToPlain(i,n))}deserialize(i,n,h){const A=JSON.parse(n);return this.plainToInstance(i,A,h)}deserializeArray(i,n,h){const A=JSON.parse(n);return this.plainToInstance(i,A,h)}};function B(c,i,n){return p.plainToInstance(c,i,n)}function w(c,i,n){return p.plainToInstance(c,i,n)}},31061:(T,P,d)=>{d.d(P,{m:()=>a});var t=d(91415);const a=new class s{constructor(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}addTypeMetadata(l){this._typeMetadatas.has(l.target)||this._typeMetadatas.set(l.target,new Map),this._typeMetadatas.get(l.target).set(l.propertyName,l)}addTransformMetadata(l){this._transformMetadatas.has(l.target)||this._transformMetadatas.set(l.target,new Map),this._transformMetadatas.get(l.target).has(l.propertyName)||this._transformMetadatas.get(l.target).set(l.propertyName,[]),this._transformMetadatas.get(l.target).get(l.propertyName).push(l)}addExposeMetadata(l){this._exposeMetadatas.has(l.target)||this._exposeMetadatas.set(l.target,new Map),this._exposeMetadatas.get(l.target).set(l.propertyName,l)}addExcludeMetadata(l){this._excludeMetadatas.has(l.target)||this._excludeMetadatas.set(l.target,new Map),this._excludeMetadatas.get(l.target).set(l.propertyName,l)}findTransformMetadatas(l,o,u){return this.findMetadatas(this._transformMetadatas,l,o).filter(g=>!g.options||!0===g.options.toClassOnly&&!0===g.options.toPlainOnly||(!0===g.options.toClassOnly?u===t.h.CLASS_TO_CLASS||u===t.h.PLAIN_TO_CLASS:!0!==g.options.toPlainOnly||u===t.h.CLASS_TO_PLAIN))}findExcludeMetadata(l,o){return this.findMetadata(this._excludeMetadatas,l,o)}findExposeMetadata(l,o){return this.findMetadata(this._exposeMetadatas,l,o)}findExposeMetadataByCustomName(l,o){return this.getExposedMetadatas(l).find(u=>u.options&&u.options.name===o)}findTypeMetadata(l,o){return this.findMetadata(this._typeMetadatas,l,o)}getStrategy(l){const o=this._excludeMetadatas.get(l),u=o&&o.get(void 0),g=this._exposeMetadatas.get(l),p=g&&g.get(void 0);return u&&p||!u&&!p?"none":u?"excludeAll":"exposeAll"}getExposedMetadatas(l){return this.getMetadata(this._exposeMetadatas,l)}getExcludedMetadatas(l){return this.getMetadata(this._excludeMetadatas,l)}getExposedProperties(l,o){return this.getExposedMetadatas(l).filter(u=>!u.options||!0===u.options.toClassOnly&&!0===u.options.toPlainOnly||(!0===u.options.toClassOnly?o===t.h.CLASS_TO_CLASS||o===t.h.PLAIN_TO_CLASS:!0!==u.options.toPlainOnly||o===t.h.CLASS_TO_PLAIN)).map(u=>u.propertyName)}getExcludedProperties(l,o){return this.getExcludedMetadatas(l).filter(u=>!u.options||!0===u.options.toClassOnly&&!0===u.options.toPlainOnly||(!0===u.options.toClassOnly?o===t.h.CLASS_TO_CLASS||o===t.h.PLAIN_TO_CLASS:!0!==u.options.toPlainOnly||o===t.h.CLASS_TO_PLAIN)).map(u=>u.propertyName)}clear(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()}getMetadata(l,o){const u=l.get(o);let g;u&&(g=Array.from(u.values()).filter(e=>void 0!==e.propertyName));const p=[];for(const e of this.getAncestors(o)){const E=l.get(e);if(E){const x=Array.from(E.values()).filter(B=>void 0!==B.propertyName);p.push(...x)}}return p.concat(g||[])}findMetadata(l,o,u){const g=l.get(o);if(g){const p=g.get(u);if(p)return p}for(const p of this.getAncestors(o)){const e=l.get(p);if(e){const E=e.get(u);if(E)return E}}}findMetadatas(l,o,u){const g=l.get(o);let p;g&&(p=g.get(u));const e=[];for(const E of this.getAncestors(o)){const x=l.get(E);x&&x.has(u)&&e.push(...x.get(u))}return e.slice().reverse().concat((p||[]).slice().reverse())}getAncestors(l){if(!l)return[];if(!this._ancestorsMap.has(l)){const o=[];for(let u=Object.getPrototypeOf(l.prototype.constructor);typeof u.prototype<"u";u=Object.getPrototypeOf(u.prototype.constructor))o.push(u);this._ancestorsMap.set(l,o)}return this._ancestorsMap.get(l)}}}}]);