dealpos 26.16.2 → 26.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/browser/{chunk-7EHCEG4Q.js → chunk-27DKZWKK.js} +1 -1
  2. package/browser/{chunk-KX67XBOO.js → chunk-2M5OGOMI.js} +1 -1
  3. package/browser/{chunk-UG7IIQ3F.js → chunk-2P5DR6BM.js} +1 -1
  4. package/browser/{chunk-GM52HZXS.js → chunk-33H6SOJY.js} +1 -1
  5. package/browser/{chunk-EX7UWTNP.js → chunk-3JDGPMX6.js} +1 -1
  6. package/browser/{chunk-SVJH676J.js → chunk-4ANKQTXZ.js} +2 -2
  7. package/browser/{chunk-PBROZQDU.js → chunk-4XPUQHGV.js} +2 -2
  8. package/browser/{chunk-5TTEYXK4.js → chunk-5L4GJ5Z4.js} +1 -1
  9. package/browser/{chunk-6VQSXZFA.js → chunk-5PL7AJVD.js} +1 -1
  10. package/browser/{chunk-4JTVVQ7W.js → chunk-5PYXTMWC.js} +1 -1
  11. package/browser/{chunk-A5FQDC3G.js → chunk-67UZ2CAI.js} +1 -1
  12. package/browser/{chunk-BLYNIVNG.js → chunk-6EEV5NSO.js} +1 -1
  13. package/browser/{chunk-CEKNIJ32.js → chunk-6GMIL6RX.js} +1 -1
  14. package/browser/{chunk-HMWG7KQV.js → chunk-6TQXCSLQ.js} +1 -1
  15. package/browser/{chunk-A7UZVVOG.js → chunk-6UGI6N4C.js} +1 -1
  16. package/browser/{chunk-EG6JNBK2.js → chunk-6ZVJWH6J.js} +1 -1
  17. package/browser/{chunk-C5R7HYP7.js → chunk-7MSVOCEL.js} +1 -1
  18. package/browser/{chunk-7QMS4EYT.js → chunk-ACNAYX2N.js} +1 -1
  19. package/browser/{chunk-M6PMDWRR.js → chunk-BPGYEPLG.js} +1 -1
  20. package/browser/{chunk-N2U4JN63.js → chunk-BS2DDKXR.js} +1 -1
  21. package/browser/{chunk-3JWZ5DCP.js → chunk-BWB2XMSZ.js} +1 -1
  22. package/browser/{chunk-VAEMQKMB.js → chunk-CLRMAUDT.js} +1 -1
  23. package/browser/{chunk-J6U233NF.js → chunk-DC55MAQ5.js} +1 -1
  24. package/browser/{chunk-NIMYS7D6.js → chunk-DOA3CIFN.js} +1 -1
  25. package/browser/{chunk-CFFRGANU.js → chunk-E3U3SCNS.js} +1 -1
  26. package/browser/{chunk-2G55SXYE.js → chunk-ETABGZL5.js} +1 -1
  27. package/browser/{chunk-AOXPJUGG.js → chunk-FOYJYMLW.js} +1 -1
  28. package/browser/{chunk-BIXJATEJ.js → chunk-GRJWTO3A.js} +1 -1
  29. package/browser/{chunk-KKBTLY3V.js → chunk-H5BE7QTJ.js} +1 -1
  30. package/browser/{chunk-YAH623GO.js → chunk-HM3ZQECL.js} +1 -1
  31. package/browser/{chunk-QKWUCGPM.js → chunk-HX6FL6OG.js} +1 -1
  32. package/browser/{chunk-EE5NZHGE.js → chunk-J5MWILIW.js} +2 -2
  33. package/browser/{chunk-SN6JYVJK.js → chunk-JOJOULTA.js} +1 -1
  34. package/browser/{chunk-G7TZ7MPH.js → chunk-JQS2SMSY.js} +1 -1
  35. package/browser/{chunk-JWUHX2ET.js → chunk-KIYLIYDS.js} +1 -1
  36. package/browser/{chunk-BF7YNPJY.js → chunk-KT47FJ4U.js} +2 -2
  37. package/browser/{chunk-UTAUNWNJ.js → chunk-LCUN2I4C.js} +1 -1
  38. package/browser/{chunk-P34UHXET.js → chunk-LGK523UU.js} +1 -1
  39. package/browser/{chunk-EFK3TBWO.js → chunk-LP7UTKTL.js} +1 -1
  40. package/browser/{chunk-A4YZQAMR.js → chunk-LUXLN3PP.js} +1 -1
  41. package/browser/{chunk-VMQ6TDTL.js → chunk-N5LXWWP4.js} +1 -1
  42. package/browser/{chunk-CJKLMMTM.js → chunk-NAXCQWF7.js} +1 -1
  43. package/browser/{chunk-3IVVIJCD.js → chunk-NFXJJFGK.js} +1 -1
  44. package/browser/{chunk-EZCVGBAR.js → chunk-OF5JVNNQ.js} +1 -1
  45. package/browser/{chunk-BONQYLII.js → chunk-OHUE6LJN.js} +1 -1
  46. package/browser/{chunk-MYCG7QBW.js → chunk-OVSSOJR7.js} +1 -1
  47. package/browser/{chunk-Q5ULM24Y.js → chunk-PHNLOPXR.js} +2 -2
  48. package/browser/{chunk-K26ZQQJE.js → chunk-PNH5Y66E.js} +1 -1
  49. package/browser/{chunk-SKE7KFMP.js → chunk-PO5MQRYU.js} +1 -1
  50. package/browser/{chunk-JWOMTKKN.js → chunk-PS3OAEKV.js} +1 -1
  51. package/browser/{chunk-RQDOP7TE.js → chunk-PTJ5STKQ.js} +1 -1
  52. package/browser/{chunk-INHXSO5N.js → chunk-Q3D6XAFQ.js} +1 -1
  53. package/browser/{chunk-WIHZOM3C.js → chunk-Q7PMSM2B.js} +1 -1
  54. package/browser/{chunk-YOFZWYR5.js → chunk-QDZ5K5ZH.js} +1 -1
  55. package/browser/{chunk-LRM4CXVP.js → chunk-QFFTSYQT.js} +1 -1
  56. package/browser/{chunk-4DD3WNHI.js → chunk-QLIOL3IZ.js} +1 -1
  57. package/browser/{chunk-NGRABHNJ.js → chunk-RLKLAIP5.js} +1 -1
  58. package/browser/{chunk-F4L5BXVH.js → chunk-RMOJ6R2Q.js} +2 -2
  59. package/browser/{chunk-LJQLHNQX.js → chunk-RMWQ2UTD.js} +1 -1
  60. package/browser/{chunk-GO5NVTB3.js → chunk-S4L5E7IE.js} +1 -1
  61. package/browser/{chunk-QFE73YCL.js → chunk-SDBIYLUT.js} +1 -1
  62. package/browser/{chunk-U5P34LSK.js → chunk-SQO6QK6G.js} +1 -1
  63. package/browser/{chunk-YFB4XBRI.js → chunk-STTYRDAE.js} +1 -1
  64. package/browser/{chunk-SFKUAKOZ.js → chunk-TA33BFJL.js} +1 -1
  65. package/browser/{chunk-4DCCSX5X.js → chunk-TFGHYUS3.js} +1 -1
  66. package/browser/{chunk-YXDFR7LR.js → chunk-TYCAYUMW.js} +1 -1
  67. package/browser/{chunk-UORHM35V.js → chunk-TZ2VMZJX.js} +1 -1
  68. package/browser/{chunk-LO2STX72.js → chunk-U5DJ3CUP.js} +1 -1
  69. package/browser/{chunk-5GZZLIPG.js → chunk-URDLZY7T.js} +2 -2
  70. package/browser/{chunk-XS7VRFB2.js → chunk-V2MBKW7M.js} +1 -1
  71. package/browser/{chunk-WQXI4QPG.js → chunk-VCGAUIRL.js} +1 -1
  72. package/browser/{chunk-73SF2ZFB.js → chunk-WKVQPHD3.js} +1 -1
  73. package/browser/{chunk-OHT4K7PJ.js → chunk-XGMSENTJ.js} +1 -1
  74. package/browser/{chunk-FCOOCXGL.js → chunk-XMDLTSUM.js} +1 -1
  75. package/browser/{chunk-LNIPP7G5.js → chunk-Y5PVZUEP.js} +1 -1
  76. package/browser/{chunk-GQV5W3GF.js → chunk-YKS2X2FE.js} +1 -1
  77. package/browser/{chunk-6JN6533M.js → chunk-YKY7ZJGL.js} +1 -1
  78. package/browser/{chunk-U5IOZ6AH.js → chunk-ZEQ236EM.js} +1 -1
  79. package/browser/{chunk-VNS2RE77.js → chunk-ZGORCIAA.js} +1 -1
  80. package/browser/{chunk-RZSUC7LK.js → chunk-ZYUEO2KK.js} +1 -1
  81. package/browser/index.html +2 -2
  82. package/browser/{main-ORTGLHFM.js → main-ATQUBPA2.js} +2 -2
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as ki}from"./chunk-V47BF5NR.js";import{a as Ei,e as Oi,f as Ti}from"./chunk-RRKYFJCV.js";import{a as pe}from"./chunk-YZTV3CZR.js";import{a as Mi}from"./chunk-EMQK4JF7.js";import{a as wi}from"./chunk-DU73NSE6.js";import{a as Pi}from"./chunk-JNZ42KTE.js";import"./chunk-UD2YNGJT.js";import{a as mi}from"./chunk-W52Y2CTX.js";import"./chunk-YGTSYNJ4.js";import{a as Di}from"./chunk-HBAQBI6Z.js";import{b as ui,c as gi}from"./chunk-SLDTP6YZ.js";import"./chunk-JP66BF4L.js";import{b as yi,c as le}from"./chunk-E6X2UHSN.js";import{a as Ii}from"./chunk-X4P6TIDV.js";import{a as oe}from"./chunk-46FATRR5.js";import{a as xi,b as Si}from"./chunk-WIODXTKB.js";import{a as fi,b as bi,c as _i,d as ae,e as vi}from"./chunk-LRGIUDMK.js";import"./chunk-NQX7EX5A.js";import"./chunk-SLAM367X.js";import{b as Ci}from"./chunk-CONGWQP2.js";import{a as ce,b as se,c as me}from"./chunk-7X4VZXLW.js";import"./chunk-UKRO3R7X.js";import{a as re}from"./chunk-XOJZGUT3.js";import{a as hi}from"./chunk-Z6DGFGP3.js";import"./chunk-7VUJP4ZL.js";import"./chunk-Z3E24JZW.js";import{c as pi}from"./chunk-NSNUUKNK.js";import"./chunk-DDLXGCOB.js";import{a as di}from"./chunk-XV3LZZ5N.js";import"./chunk-ZOY3GIWS.js";import"./chunk-CIDPGJ5I.js";import"./chunk-3XXHI4EL.js";import"./chunk-OFAMZL4W.js";import"./chunk-PRC6BIGW.js";import"./chunk-XRHB5YFU.js";import"./chunk-JGRL2V64.js";import"./chunk-77OYJ25Y.js";import"./chunk-IGAEFS7B.js";import"./chunk-4M7RPVWV.js";import"./chunk-5FZQUUGO.js";import{g as si}from"./chunk-YFB4XBRI.js";import"./chunk-IEXCLXA2.js";import{a as ft}from"./chunk-7TPO6NBM.js";import{a as ti,d as ei,f as ii,h as ni}from"./chunk-NLFBNSNG.js";import"./chunk-LRM4CXVP.js";import{a as oi}from"./chunk-M42U7VID.js";import{a as ri}from"./chunk-U5IOZ6AH.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import"./chunk-LZNSQRCR.js";import"./chunk-BCH2MDJT.js";import"./chunk-INL666X3.js";import{k as Ze,o as ai,q as li,r as ci}from"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import{a as ie,b as ne}from"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import{P as L}from"./chunk-5VLBYHUJ.js";import{d as Ft}from"./chunk-Q7OVBNEW.js";import"./chunk-V5VDOLOZ.js";import{a as At,b as Vt,c as nt}from"./chunk-6RFU4RXC.js";import{a as k,b as B}from"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import{a as St,b as kt,c as Nt}from"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import"./chunk-FMECWSCG.js";import{E as it,F as wt,a as ee,c as tt,h as G,l as Ot,o as et,r as Ye,s as Tt}from"./chunk-QMS2MBIA.js";import"./chunk-YAH623GO.js";import{a as Xe}from"./chunk-SFKUAKOZ.js";import"./chunk-WLVEHCCR.js";import{b as Ct}from"./chunk-P7GOTTNS.js";import{a as g}from"./chunk-3DEA4WWC.js";import"./chunk-JWOMTKKN.js";import{n as te,q as J}from"./chunk-3GXUD7K4.js";import{Ba as je,Bb as C,Bc as Mt,Ca as V,Cc as Yt,Db as f,Dc as $,E as Ae,Ec as Je,F as P,Fa as w,Fb as mt,Gb as pt,Hb as dt,Ib as u,J as Ve,Jb as r,Kb as a,Kc as v,Lb as S,Lc as y,Mb as X,Mc as Te,N as Fe,Nb as at,Ob as $e,Pb as ut,Qb as gt,R as Re,Rd as Ke,Sa as zt,T as Be,Tc as q,Td as Et,Ua as Gt,Ub as F,Ud as Xt,Wd as Zt,X as Ue,Xa as Jt,Xb as d,Yb as Dt,Z as It,Za as c,Zb as m,ba as K,bc as qe,cc as He,d as ke,dc as ze,eb as Y,ga as O,gb as Qe,hc as Kt,ib as M,ic as Ge,k as Ne,mc as s,md as Z,na as T,nb as Le,nc as R,o as Ee,ob as We,oc as x,pc as xt,ra as p,rc as U,sc as j,sd as Pt,tc as Q,u as st,va as b,wa as _,wd as z,xc as Oe,zd as A}from"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import{a as N,b as jt}from"./chunk-SNAKHGZS.js";var de=class{AppConfigJSON;Currencies;SalesOrderTags;Entities;Payments;Taxes;SalesPOTypes;EstimateOptions;Data};var Rt=class{CurrencyID;CustomerID;Date;Discount;DiscountAmount;EntityID;ID;Note;Number;SalesID;TaxTypeID;TypeID;constructor(){this.CustomerID=g.GuidEmpty,this.EntityID=g.GuidEmpty,this.ID=g.GuidEmpty,this.TaxTypeID=g.GuidEmpty,this.Discount=0,this.DiscountAmount=0,this.Date=new Date().toDateString(),this.Note=""}};var ot=class{Email;Key;Mobile;Name;Phone;Value;PricebookID;StateID};var ue=class{ID;Index;Symbol;Name;ExchangeRate;ConversionSuggestion;ExchangeRateDate;ExchangeRateDateDisplay};var ge=class{ID;Name;DueDays;BlockDays;Description;PrintTemplateID;AccountID};var Ce=class{DeliveryID;InvoiceID;InvoiceNumber;Message;OrderID;PaymentStateID;PaymentStateLabel;PrintMode;Success};var I=class n{estimateState=wi({loadForm:new de,outlet:{Name:"",ID:g.GuidEmpty},order:new Rt,cartItems:[],customer:new ot,tax:new gi,currency:new ue,tag:new ge,discount:{discountAmount:0,discount:0},state:0,complete:new Ce});loadForm=this.estimateState.select(t=>Object.freeze(t.loadForm()));order=this.estimateState.select(t=>Object.freeze(t.order()));outlet=this.estimateState.select(t=>Object.freeze(t.outlet()));cartItems=this.estimateState.select(t=>Object.freeze(t.cartItems()));customer=this.estimateState.select(t=>Object.freeze(t.customer()));tax=this.estimateState.select(t=>Object.freeze(t.tax()));currency=this.estimateState.select(t=>Object.freeze(t.currency()));tag=this.estimateState.select(t=>Object.freeze(t.tag()));discount=this.estimateState.select(t=>Object.freeze(t.discount()));state=this.estimateState.select(t=>Object.freeze(t.state()));complete=this.estimateState.select(t=>Object.freeze(t.complete()));updateLoadForm(t){this.estimateState.update("loadForm",t)}updateOutlet(t){this.estimateState.update("outlet",t)}updateOrder(t){this.estimateState.update("order",t)}updateCartItems(t){this.estimateState.update("cartItems",t)}updateCustomer(t){this.estimateState.update("customer",t)}updateTax(t){this.estimateState.update("tax",t)}updateCurrency(t){this.estimateState.update("currency",t)}updateTag(t){this.estimateState.update("tag",t)}updateDiscount(t){this.estimateState.update("discount",t)}updateState(t){this.estimateState.update("state",t)}updateComplete(t){this.estimateState.update("complete",t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var bt=class{ID;Name;Code;Cost;ThumbnailUrl;CouponDiscount;Discount;DiscountAmount;EntityID;Expense;InventoryTypeID;LoyaltyPoint;Note;PromotionGift;Quantity;UnitQuantity;SalesID;VariantID;VariantUnitQuantity;isMaxInventory;UOM;UOMName;UnitCost;UnitPrice;TypeID;Storage;Taxable;Price;Serial;PriceBookID;Variant;PriceTypeID;PriceNote;UnitPriceMinimum;get Total(){return this.Price*(this.Quantity*this.UnitQuantity)*((100-this.Discount)/100)}get getItemAfterDiscount(){let t=this.getDiscPercentagePerItem();return this.DiscountAmount<t?t-this.DiscountAmount:0}getDiscPercentagePerItem(){let t=this.UnitPrice;return this.Discount>0&&(t=(100-this.Discount)/100*this.UnitPrice),t}};var _t=class n{constructor(){}generateCartItem(t){let e=new bt;return e.Name=t.Name,e.ThumbnailUrl=t.ThumbnailUrl,e.Price=t.UnitPrice,e.UnitPrice=t.UnitPrice,e.UnitCost=t.UnitCost,e.UnitQuantity=t.UnitQuantity,e.Quantity=1,e.Code=t.Code,e.TypeID=t.TypeID,e.Discount=t.PriceDiscount,e.VariantUnitQuantity=t.VariantUnitQuantity,e.Storage=t.Storage,e.UOM=t.UOM,e.UOMName=t.UOMName,e.VariantID=t.ID,e.Taxable=t.Taxable,e.InventoryTypeID=t.TypeID,e.PriceTypeID=t.PriceTypeID,e.PriceNote=t.PriceNote,e.Variant=t,e.UnitPriceMinimum=t.UnitPriceMinimum,e}generateCartItemOnEdit(t){let e=new bt;return e.ID=t.ID,e.Name=t.Variant?.Name,e.ThumbnailUrl=t.Variant?.ThumbnailUrl,e.Price=t.Price,e.UnitPrice=t.Price,e.UnitCost=t.Cost,e.UnitQuantity=t.Variant?.UnitQuantity,e.Quantity=t.Quantity,e.Code=t.Variant?.Code,e.TypeID=t.Variant?.TypeID,e.Discount=t.Discount,e.VariantUnitQuantity=t.Variant?.VariantUnitQuantity,e.Storage=t.Variant?.Storage,e.UOM=t.Variant?.UOM,e.UOMName=t.Variant?.UOMName,e.VariantID=t.VariantID,e.Taxable=t.Taxable,e.Note=t.Note,e.Serial=t.Serial,e.InventoryTypeID=t.InventoryTypeID,e.PriceTypeID=t.PriceTypeID,e.Variant=t.Variant,e.PriceNote=t.PriceNote,e}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Qt=class n{httpService=p(J);storeService=p(I);factoryService=p(_t);activatedRoute=p(Ke);getLoadForm$=this.activatedRoute.queryParams.pipe(K(t=>this.httpService.post("/API/estimate/LoadForm",t)),O(t=>this.storeService.updateLoadForm(t)),O(t=>{g.IsNotEmpty(t.Data)?this.onEditOrder(t):(this.initDefaultCurrency(),this.initTag(),this.initTax())}),k());constructor(){this.getLoadForm$.subscribe()}onEditOrder(t){let e=t.Data,i=this.findTaxById(e.Order.TaxTypeID),o=this.findCurrencyById(e.Order.CurrencyID),l=this.findOutletById(e.Order.EntityID),h=this.findTagById(e.Order.TypeID),D=this.getCartItemsOnEdit(t);this.storeService.updateState(1),this.storeService.updateOrder(e.Order),this.storeService.updateCartItems(D),this.storeService.updateCustomer({Key:e.Order.CustomerID,Value:e.ContactName}),this.storeService.updateTax(i),this.storeService.updateCurrency(o),this.storeService.updateOutlet(l),this.storeService.updateDiscount({discount:e.Order.Discount,discountAmount:e.Order.DiscountAmount}),this.storeService.updateTag(h)}getCartItemsOnEdit(t){return t.Data.Items.map(o=>this.factoryService.generateCartItemOnEdit(o))}initDefaultCurrency(){let t=this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID,e=this.storeService.loadForm()?.Currencies.find(i=>i.ID===t);this.storeService.updateCurrency(e)}initTag(){let t=this.storeService.loadForm()?.SalesOrderTags;this.storeService.updateTag(t[0])}initTax(){let t=this.storeService.loadForm()?.Taxes;this.storeService.updateTax(t[0])}findTaxById(t){return(this.storeService.loadForm()?.Taxes).find(o=>o.ID===t)}findCurrencyById(t){return(this.storeService.loadForm()?.Currencies).find(o=>o.ID===t)}findOutletById(t){return(this.storeService.loadForm()?.Entities).find(o=>o.ID===t)}findTagById(t){return(this.storeService.loadForm()?.SalesOrderTags).find(o=>o.ID===t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Lt=class n{storeService=p(I);isOpenDialog$=B(this.storeService.loadForm).pipe(P(t=>g.IsNotEmpty(t.Entities)),st(()=>{let t=!1,e=this.storeService.state(),i=this.storeService.outlet();return(e==0||e==1)&&(t=g.IsEmpty(i.ID)),t}));updateOutlet(t){this.storeService.updateOutlet(t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac,providedIn:"root"})};var lt=class n{storeService=p(I);httpService=p(J);router=p(Et);orderNumber$=B(this.storeService.outlet).pipe(P(t=>g.IsNotEmpty(t.ID)),K(t=>{if(this.storeService.state()==0)return this.httpService.post(L.EstimateGenerateNumber,{ID:t.ID}).pipe(st(e=>e.Number));{let e=this.storeService.order().Number;return Ee(e)}}),O(t=>{this.storeService.state()==0&&this.updateOrderNumber(t)}),k());salesPersons$=B(this.storeService.outlet).pipe(K(t=>g.IsNotEmpty(t.ID)?this.httpService.get(L.GetSalesPersonByOutletId,[{key:"ID",value:t.ID}]):Ee([])),It(1));updateTagOrder$=B(this.storeService.tag).pipe(O(t=>{let e=N({},this.storeService.order());e.TypeID=t.ID,this.storeService.updateOrder(e)}),k());updateCurrencyOrder$=B(this.storeService.currency).pipe(O(t=>{let e=N({},this.storeService.order());e.CurrencyID=t.ID,this.storeService.updateOrder(e)}),k());updateTaxOrder$=B(this.storeService.tax).pipe(O(t=>{let e=N({},this.storeService.order());e.TaxTypeID=t.ID,this.storeService.updateOrder(e)}),k());updateDiscountOrder$=B(this.storeService.discount).pipe(O(t=>{let e=N({},this.storeService.order());e.Discount=t.discount,e.DiscountAmount=t.discountAmount,this.storeService.updateOrder(e)}),k());updateCustomerOrder$=B(this.storeService.customer).pipe(O(t=>{let e=N({},this.storeService.order());e.CustomerID=t.Key,this.storeService.updateOrder(e)}),k());updateEntityId$=B(this.storeService.outlet).pipe(P(t=>g.IsNotEmpty(t.ID)),O(t=>{let e=N({},this.storeService.order());e.EntityID=t.ID,this.storeService.updateOrder(e)}),k());constructor(){this.updateTagOrder$.subscribe(),this.updateCurrencyOrder$.subscribe(),this.updateTaxOrder$.subscribe(),this.updateDiscountOrder$.subscribe(),this.updateCustomerOrder$.subscribe(),this.updateEntityId$.subscribe()}newOrder(){let t=this.storeService.loadForm(),e=this.getDefaultCurrency(),i=this.storeService.outlet();this.storeService.updateOrder(new Rt),this.storeService.updateCartItems([]),this.storeService.updateCustomer(new ot),this.storeService.updateTax(N({},t.Taxes[0])),this.storeService.updateCurrency(N({},e)),this.storeService.updateTag(N({},t.SalesOrderTags[0])),this.storeService.updateDiscount({discountAmount:0,discount:0}),this.storeService.updateOutlet(N({},i)),this.router.navigate([],{queryParams:{}}),this.storeService.updateState(0)}getDefaultCurrency(){let t=this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID;return this.storeService.loadForm()?.Currencies.find(i=>i.ID===t)}updateOrderNumber(t){g.IsNotEmpty(t)&&this.storeService.order().Number!==t&&this.storeService.updateOrder(jt(N({},this.storeService.order()),{Number:t}))}updateOrderDate(t){g.IsNotEmpty(t)&&this.storeService.order().Date!==t&&this.storeService.updateOrder(jt(N({},this.storeService.order()),{Date:t}))}updateSalesPersonId(t){let e=N({},this.storeService.order());e.SalesID=t,this.storeService.updateOrder(e)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Wt=class n{storeService=p(I);httpService=p(J);quickkeys$=B(this.storeService.outlet).pipe(P(t=>g.IsNotEmpty(t.ID)),Re((t,e)=>t.ID===e.ID),K(t=>this.httpService.get(L.GetQuickKeyByEntityID,[{key:"ID",value:t.ID}])),It(1));static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Ni=n=>({"qtyBtn-disabled":n}),fe=class n{disabled=!1;decimalPlaces=4;max=1e15;min=-1e15;quantity;constructor(){}ngOnInit(){}incrementQty(){this.quantity<this.max&&(this.quantity++,this.onChange(this.quantity))}decrementQty(){this.quantity>this.min&&(this.quantity--,this.onChange(this.quantity))}quantityChange(){this.onChange(this.quantity)}onChange=t=>{};onTouched=()=>{};writeValue(t){g.IsEmpty(t)?this.quantity=0:this.quantity=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-input-quantity"]],inputs:{disabled:"disabled",decimalPlaces:"decimalPlaces",max:"max",min:"min"},features:[Mt([{provide:ee,multi:!0,useExisting:n}])],decls:6,vars:11,consts:[[1,"input-group"],["type","button","id","button-addon1",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-2","border-end-0","py-4","qty-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"],["id","txtCartQuantity","type","text","autoNum","",1,"form-control","input-numpad","qty-input","text-center",3,"ngModelChange","ngModel","disabled","decimalPlaces"],["type","button","id","button-addon2",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-5","border-start-0","py-4","qty-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"button",1),d("click",function(){return i.decrementQty()}),s(2,"-"),a(),r(3,"input",2),Q("ngModelChange",function(l){return j(i.quantity,l)||(i.quantity=l),l}),d("ngModelChange",function(){return i.quantityChange()}),a(),r(4,"button",3),d("click",function(){return i.incrementQty()}),s(5,"+"),a()()),e&2&&(c(),u("ngClass",$(7,Ni,i.disabled))("disabled",i.disabled),c(2),U("ngModel",i.quantity),u("disabled",i.disabled)("decimalPlaces",i.decimalPlaces),c(),u("ngClass",$(9,Ni,i.disabled))("disabled",i.disabled))},dependencies:[A,Z,it,tt,G,et,ft],styles:[".qtyBtn-disabled[_ngcontent-%COMP%]{background-color:#e9ecef;color:#000!important}button.qty_btn[_ngcontent-%COMP%]{background:#eee;border:1px solid #ddd;width:36px}.qty-input[_ngcontent-%COMP%]{height:36px!important}"]})};var ht=class n{storeService=p(I);autoApplyPricebook(t){let e=t?.Variant?.PriceBook?t?.Variant?.PriceBook:[],i=this.storeService.customer(),o=this.findCustomerPricebook(e,i),l=this.sortAppliedPricebooks(e,t.Quantity);return l.length>0||g.IsNotEmpty(o)?g.IsNotEmpty(o)?t=this.applyPricebook(t,o):t=this.applyPricebook(t,l[0]):t.PriceTypeID===2&&(t=this.removePricebook(t)),t}findCustomerPricebook(t=[],e){let i;return g.IsNotEmpty(e)&&g.IsNotEmpty(e?.Key)&&(i=t.find(o=>o.ID==e.PricebookID)),i}applyCustomerPricebook(){let t=[],e=this.storeService.customer(),i=this.storeService.cartItems();return g.IsNotEmpty(e.PricebookID)&&i.forEach(o=>{let l=this.findCustomerPricebook(o.Variant.PriceBook,e);l&&(o=this.applyPricebook(o,l),t.push(o))}),t}removeCustomerPricebook(t){let e=[];return this.storeService.cartItems().forEach(o=>{this.findCustomerPricebook(o.Variant.PriceBook,t)&&(o=this.removePricebook(o),e.push(o))}),e}sortAppliedPricebooks(t=[],e){return t.sort((i,o)=>o.MinimumQuantity-i.MinimumQuantity).filter(i=>e>=i.MinimumQuantity&&i.MinimumQuantity!=0)}applyPricebook(t,e){let i=this.storeService.loadForm()?.AppConfigJSON?.ModuleSell?.Pricebook?.PricebookVisible;return t.Discount=e.PriceDiscount,t.UnitPrice=e.UnitPrice,t.PriceBookID=e.ID,t.Price=e.UnitPrice,t.PriceTypeID=2,t.PriceNote=e.Name,i?t.Note=e.Name:t.Note="",t}removePricebook(t){return t.Discount=t.Variant.PriceDiscount,t.UnitPrice=t.Variant.UnitPrice,t.PriceBookID=null,t.Price=t.Variant.UnitPrice,t.PriceTypeID=0,t.Note="",t.PriceNote="",t}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var we=n=>({selected:n}),Bi=()=>["/menu/Products/Catalog/Variants/Info"],Ui=n=>({ID:n});function ji(n,t){if(n&1){let e=F();r(0,"a",13),d("click",function(){b(e);let o=m();return _(o.tabState="PRODUCT")}),s(1," Product "),a()}if(n&2){let e=m();u("ngClass",$(1,we,e.tabState=="PRODUCT"))}}function Qi(n,t){if(n&1){let e=F();r(0,"a",14),d("click",function(){b(e);let o=m();return _(o.tabState="SERIAL")}),s(1," Serial "),a()}if(n&2){let e=m();u("ngClass",$(1,we,e.tabState=="SERIAL"))}}function Li(n,t){if(n&1&&(r(0,"div",10),S(1,"div",15),a()),n&2){let e=m();c(),u("innerHTML",e.cartItemService.priceMinimumRestrictionWarning(),zt)}}function Wi(n,t){if(n&1&&(r(0,"div",16)(1,"div",25),S(2,"POS-variant-autocomplete",26),a()()),n&2){let e=m(2);c(2),u("formControl",e.variantSearchCtrl)}}function $i(n,t){if(n&1&&(r(0,"span"),s(1),a()),n&2){let e=m(2);c(),x("(",e.cartItem().UOMName,")")}}function qi(n,t){if(n&1){let e=F();r(0,"div",19)(1,"h6"),s(2,"Pricebook"),a(),r(3,"ng-select",27),Q("ngModelChange",function(o){b(e);let l=m(2);return j(l.cartItem().PriceBookID,o)||(l.cartItem().PriceBookID=o),_(o)}),d("ngModelChange",function(o){b(e);let l=m(2);return _(l.onSelectPricebook(o))}),a()()}if(n&2){let e,i=m(2);c(3),u("items",(e=i.cartItem())==null||e.Variant==null?null:e.Variant.PriceBook),U("ngModel",i.cartItem().PriceBookID)}}function Hi(n,t){if(n&1){let e=F();C(0,Wi,3,1,"div",16),r(1,"div",16)(2,"div",17)(3,"h6"),s(4," Qty "),C(5,$i,2,1,"span"),a(),r(6,"POS-input-quantity",18,0),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Quantity,o)||(l.cartItem().Quantity=o),_(o)}),d("ngModelChange",function(){b(e);let o=m();return _(o.onQtyChange())}),a()(),r(8,"div",19)(9,"h6"),s(10,"Discount (%)"),a(),r(11,"input",20),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Discount,o)||(l.cartItem().Discount=o),_(o)}),a()(),r(12,"div",19)(13,"h6"),s(14,"Price"),a(),r(15,"input",21,1),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Price,o)||(l.cartItem().Price=o),_(o)}),a()(),C(17,qi,4,2,"div",19),a(),r(18,"div",22)(19,"div",23)(20,"POS-tinymce-editor",24),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Note,o)||(l.cartItem().Note=o),_(o)}),a()()()}if(n&2){let e,i=m();f(i.isEditState()==!1?0:-1),c(5),f(i.cartItem().UOMName?5:-1),c(),U("ngModel",i.cartItem().Quantity),u("decimalPlaces",i.isSerialItem()?0:4),c(5),U("ngModel",i.cartItem().Discount),c(4),U("ngModel",i.cartItem().Price),u("disabled",!(!(i.roleService==null||i.roleService.sell==null)&&i.roleService.sell.UnitPriceEditor)),c(2),f(((e=i.cartItem().Variant)==null||e.PriceBook==null?null:e.PriceBook.length)>0?17:-1),c(3),U("ngModel",i.cartItem().Note)}}function zi(n,t){n&1&&(S(0,"i",44),r(1,"h6"),s(2,"No Image"),a())}function Gi(n,t){if(n&1&&S(0,"img",30),n&2){let e=m(2);u("src",e.cartItem().ThumbnailUrl,Gt)}}function Ji(n,t){if(n&1&&(r(0,"tr")(1,"td",45),s(2),v(3,"number"),a(),r(4,"td",45),s(5),v(6,"number"),a(),r(7,"td",45),s(8),v(9,"number"),a()()),n&2){let e=t;c(2),x(" ",y(3,3,e==null?null:e.OnHand)," "),c(3),x(" ",y(6,5,e==null?null:e.Allocated)," "),c(3),x(" ",y(9,7,(e==null?null:e.OnHand)-(e==null?null:e.Allocated))," ")}}function Ki(n,t){if(n&1){let e=F();r(0,"tr")(1,"th",42),s(2,"Cost"),a(),r(3,"td",46)(4,"input",47),Q("ngModelChange",function(o){b(e);let l=m(2);return j(l.cartItem().UnitCost,o)||(l.cartItem().UnitCost=o),_(o)}),a()()()}if(n&2){let e,i=m(2);c(4),U("ngModel",i.cartItem().UnitCost),u("readonly",!(!((e=i.appConfig())==null||e.ModuleSell==null)&&e.ModuleSell.Cost.Enabled))}}function Yi(n,t){if(n&1&&(r(0,"tr")(1,"th",42),s(2,"Content"),a(),r(3,"td",43)(4,"div",48),s(5),v(6,"number"),a()()()),n&2){let e,i=m(2);c(5),xt(" ",(e=i.cartItem())==null?null:e.VariantUnitQuantity," (@",y(6,2,i.cartItem().Price/((e=i.cartItem())==null?null:e.VariantUnitQuantity)),")")}}function Xi(n,t){if(n&1&&(r(0,"div",40)(1,"table",49)(2,"thead")(3,"tr")(4,"th",50),s(5,"Storage Location"),a()()(),r(6,"tbody")(7,"tr")(8,"td"),s(9),a()()()()()),n&2){let e=m(2);c(9),x(" ",e.cartItem().Storage," ")}}function Zi(n,t){if(n&1&&(r(0,"div",11)(1,"div",28)(2,"a",29),C(3,zi,3,0)(4,Gi,1,1,"img",30),a()(),r(5,"div",31)(6,"div",32)(7,"div",23)(8,"div",33),S(9,"i",34),r(10,"div",35),s(11,"Inventory"),a()(),r(12,"table",36)(13,"thead")(14,"tr")(15,"th",37),s(16,"On Hand"),a(),r(17,"th",37),s(18,"Allocated"),a(),r(19,"th",38),s(20,"Available"),a()()(),r(21,"tbody"),C(22,Ji,10,9,"tr"),v(23,"async"),a()()()(),r(24,"div",39)(25,"div",40)(26,"table",41)(27,"thead"),C(28,Ki,5,2,"tr"),r(29,"tr")(30,"th",42),s(31,"Price"),a(),r(32,"td",43),s(33),v(34,"number"),a()(),C(35,Yi,7,4,"tr"),a()()(),C(36,Xi,10,1,"div",40),a()()()),n&2){let e,i,o,l,h,D,W,rt=m();c(2),u("routerLink",Yt(12,Bi))("queryParams",$(13,Ui,(e=rt.cartItem())==null?null:e.ID)),c(),f(((i=rt.cartItem())==null?null:i.ThumbnailUrl)==null?3:4),c(19),f((o=y(23,8,rt.variantInventory$))?22:-1,o),c(6),f(!((l=rt.appConfig())==null||l.ModuleSell==null)&&l.ModuleSell.Cost.Visible&&rt.roleService.product.Cost?28:-1),c(5),x(" ",y(34,10,(h=rt.cartItem())==null?null:h.Price)," "),c(2),f(((D=rt.cartItem())==null?null:D.VariantUnitQuantity)>1?35:-1),c(),f(!((W=rt.appConfig())==null||W.ModuleSell==null||W.ModuleSell.Grid==null)&&W.ModuleSell.Grid.StorageVisible&&((W=rt.cartItem())!=null&&W.Storage)?36:-1)}}function tn(n,t){if(n&1){let e=F();r(0,"app-item-serial",51),d("cartItemChange",function(o){b(e);let l=m();return _(l.onSerialChanges(o))}),a()}if(n&2){let e=m();u("entityId",e.storeService.outlet().ID)("cartItem",e.cartItem())}}var qt=class n{constructor(t,e){this.data=t;this.dialogRef=e;this.cartItem=w(t),this.initVariantInventory(),this.initIsSerialItem(),this.initModalConfig(),this.initDialogState()}storeService=p(I);cartItemService=p(ct);roleService=p(Ct);toastr=p(te);pricebookService=p(ht);modalConfig=new kt;tabState="CART";cartItem;appConfig=w(this.storeService.loadForm()?.AppConfigJSON);isSerialItem=w(!1);variantInventory$;isEditState=w(!1);showProductTab=w(!1);variantSearchCtrl=new Ot;getItemFromSearch$=this.variantSearchCtrl.valueChanges.pipe(P(t=>g.IsNotEmpty(t)),K(t=>{if(t.type==="ID")return this.cartItemService.getItemByVariantId(t.str);if(t.type==="Code")return this.cartItemService.getItemByVariantByCode(t.str)}),O(t=>{this.cartItem.set(t),this.initModalTitle(),this.initProductTab(),this.initIsSerialItem(),this.initVariantInventory()}),k());ngOnInit(){this.isEditState()||this.getItemFromSearch$.subscribe()}initDialogState(){this.isEditState.set(g.IsNotEmpty(this.cartItem().VariantID)),this.initProductTab()}initVariantInventory(){this.variantInventory$=this.cartItemService.getVariantInventory(this.cartItem().VariantID).pipe(It(1))}initProductTab(){this.showProductTab.set(g.IsNotEmpty(this.cartItem().VariantID))}initIsSerialItem(){this.isSerialItem.set(this.cartItem().TypeID==9)}initModalConfig(){this.initModalTitle(),this.modalConfig.customWidth="680px",this.modalConfig.noPadding=!0,this.modalConfig.bodyScrollable=!0}initModalTitle(){this.modalConfig.title=this.cartItem()?.Name??"Add Variant"}onSerialChanges(t){this.cartItem.set(t)}onQtyChange(){let t=this.pricebookService.autoApplyPricebook(this.cartItem());this.cartItem.set(t)}onSelectPricebook(t){let e;if(g.IsNotEmpty(t)){let o=this.cartItem().Variant.PriceBook.find(l=>l.ID===t);e=this.pricebookService.applyPricebook(this.cartItem(),o)}else e=this.pricebookService.removePricebook(this.cartItem());this.cartItem.set(e)}onCancel(){this.dialogRef.close()}onSave(){if(g.IsNotEmpty(this.cartItem().VariantID)&&g.IsNotEmpty(this.cartItem().Name)){if(!this.cartItemService.validatePriceMinimum(this.cartItem(),this.appConfig))return;this.dialogRef.close(this.cartItem())}else this.toastr.warning("Please select a product","Warning")}ngOnDestroy(){this.cartItemService.priceMinimumRestrictionWarning.set("")}static \u0275fac=function(e){return new(e||n)(Y(Vt),Y(At))};static \u0275cmp=M({type:n,selectors:[["app-dialog-item"]],decls:14,vars:10,consts:[["quantity",""],["price",""],[3,"onOk","onCancel","onClose","config"],[1,"mb-5"],[1,"container","w-100","h-100","mt-8"],[1,"row","border-bottom","mx-5"],["data-cy","input_sell",1,"btn","btn-link",3,"click","ngClass"],["data-cy","product",1,"btn","btn-link",3,"ngClass"],["data-cy","serial",1,"btn","btn-link",3,"ngClass"],[1,"mx-8"],[1,"bg-gradient-warning","p-4","justify-content-center","align-items-center","d-flex","gap-2",2,"margin-top","12px","border-radius","8px"],[1,"row","my-8"],[3,"entityId","cartItem"],["data-cy","product",1,"btn","btn-link",3,"click","ngClass"],["data-cy","serial",1,"btn","btn-link",3,"click","ngClass"],[3,"innerHTML"],[1,"row","mt-8"],[1,"col-auto","pe-0",2,"width","145px"],[3,"ngModelChange","ngModel","decimalPlaces"],[1,"col-auto","pe-0"],["type","text","percentage","","autoNum","",1,"form-control","input-cart",2,"width","100px",3,"ngModelChange","ngModel"],["id","inputPrice","type","text","autoNum","",1,"form-control","input-cart",2,"width","112px",3,"ngModelChange","ngModel","disabled"],[1,"row","my-6"],[1,"col-12"],["height","220px",3,"ngModelChange","ngModel"],[1,"col-12","px-0"],[3,"formControl"],["bindLabel","Name","bindValue","ID","placeholder","Pricebook","appendTo","body",2,"width","170px",3,"ngModelChange","items","ngModel"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[1,"border","rounded",3,"src"],[1,"col-sm-8","inventory"],[1,"row","mb-8"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family","'Roboto Slab'"],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","py-6","border-end",2,"text-transform","none"],[1,"table-light","py-6",2,"text-transform","none"],[1,"row"],[1,"col-6"],[1,"table","table-bordered",2,"width","171px"],[1,"table-light",2,"text-transform","none"],[1,"pe-6","text-end"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"py-6"],[1,"p-0"],["type","text","autoNum","",1,"form-control","border-0","bg-white","text-end",3,"ngModelChange","ngModel","readonly"],["ngClass","ms-3"],[1,"table","table-bordered","text-center"],[1,"table-light"],[3,"cartItemChange","entityId","cartItem"]],template:function(e,i){e&1&&(r(0,"modal-material",2),d("onOk",function(){return i.onSave()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),r(1,"content",3)(2,"div",4)(3,"div",5)(4,"div")(5,"a",6),d("click",function(){return i.tabState="CART"}),s(6," Cart "),a(),C(7,ji,2,3,"a",7),C(8,Qi,2,3,"a",8),a()(),r(9,"div",9),C(10,Li,2,1,"div",10),C(11,Hi,21,9),C(12,Zi,37,15,"div",11),C(13,tn,1,2,"app-item-serial",12),a()()()()),e&2&&(u("config",i.modalConfig),c(5),u("ngClass",$(8,we,i.tabState=="CART")),c(2),f(i.showProductTab()?7:-1),c(),f(i.isSerialItem()?8:-1),c(2),f(i.cartItemService.priceMinimumRestrictionWarning()&&i.cartItemService.priceMinimumRestrictionWarning().trim()!==""?10:-1),c(),f(i.tabState=="CART"?11:-1),c(),f(i.tabState=="PRODUCT"?12:-1),c(),f(i.tabState=="SERIAL"?13:-1))},dependencies:[A,Z,Nt,it,tt,G,et,ft,re,Zt,Xt,pe,wt,Tt,Si,xi,fe,Ft,Pt,z],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.input-cart[_ngcontent-%COMP%]{height:36px!important}"]})};var ct=class n{httpService=p(J);storeService=p(I);factoryService=p(_t);pricebookService=p(ht);userRoleService=p(ui);decimalPipe=p(z);dialog=p(nt);variantSearchCtrl=new Ot;viewContainerRef=p(Qe);selectedCustomer;cartItemEvent=new ke;onEditCartItems$=B(this.storeService.cartItems).pipe(P(()=>this.storeService.state()==1),st(t=>({action:"INIT",items:t})),Be());priceMinimumRestrictionWarning=w("");applyCustomerPricebook$=B(this.storeService.customer).pipe(O(t=>{this.onApplyCustomerPricebook(t)}),k());cartItems$=Ae(this.onEditCartItems$,this.cartItemEvent.asObservable()).pipe(Ue((t,e)=>{let i=[];switch(e.action){case"INIT":i=e.items;break;case"ADD":i=this.addNewItem(t,e);break;case"UPDATE":i=this.updateItems(t,e);break;case"REMOVE":i=t.filter((o,l)=>e.index!==l);break;case"CLEAR":i=[];break;case"PURCHASE":i=this.updateItems(t,e);break;case"RETURN":i=this.updateItems(t,e);break;case"DROP":i=e.items;break}return this.storeService.updateCartItems(i),i},this.storeService.cartItems()));addCartItemBySearch$=this.variantSearchCtrl.valueChanges.pipe(P(t=>g.IsNotEmpty(t)),O(t=>{t.type==="ID"?this.addItemByVariantId(t.str):t.type==="Code"&&this.addItemByVariantCode(t.str)}),k());constructor(){this.addCartItemBySearch$.subscribe(),this.applyCustomerPricebook$.subscribe()}onApplyCustomerPricebook(t){let e=[],i=this.storeService.cartItems();g.IsNotEmpty(t.PricebookID)?(this.selectedCustomer=t,e=this.pricebookService.applyCustomerPricebook()):g.IsNotEmpty(this.selectedCustomer)&&(e=this.pricebookService.removeCustomerPricebook(this.selectedCustomer),this.selectedCustomer=null),i.forEach((o,l)=>{let h=e.find(D=>D.VariantID===o.VariantID);h&&this.updateCartItem({cartItem:h,index:l})})}onApplyPricebook(t){return this.pricebookService.autoApplyPricebook(t)}onOpenAddDialog(){this.dialog.open(qt,{data:new bt,viewContainerRef:this.viewContainerRef}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{this.cartItemEvent.next({item:t,action:"ADD",newRow:!0})})}onOpenEditDialog(t){this.dialog.open(qt,{data:N({},t.cartItem),viewContainerRef:this.viewContainerRef}).afterClosed().pipe(P(e=>g.IsNotEmpty(e))).subscribe(e=>{this.cartItemEvent.next({item:e,action:"UPDATE",index:t.index})})}onSelectQuickkeyItem(t){this.addItemByVariantId(t)}addNewItem(t,e){let i=[],o=t.find(l=>l.VariantID===e.item?.VariantID);return o?e.newRow?(e.item=this.onApplyPricebook(e.item),i=[...t,e.item]):(o.Quantity+=1,o=this.onApplyPricebook(o),i=[...t]):(e.item=this.onApplyPricebook(e.item),i=[...t,e.item]),i}updateItems(t,e){return t.map((o,l)=>l===e.index?pi(bt,e.item):o)}onDropItems(t){this.cartItemEvent.next({action:"DROP",items:t})}addItemByVariantId(t){this.getItemByVariantId(t).pipe(O(e=>{this.cartItemEvent.next({item:e,action:"ADD",newRow:!1})})).subscribe()}addItemByVariantCode(t){this.getItemByVariantByCode(t).pipe(O(e=>{this.cartItemEvent.next({item:e,action:"ADD",newRow:!1})})).subscribe()}removeCartItem(t){this.cartItemEvent.next({action:"REMOVE",index:t.index})}updateCartItem(t){this.cartItemEvent.next({action:"UPDATE",item:t.cartItem,index:t.index})}clearCart(){this.dialog.open(ki,{data:{title:"Clear Order Items",message:'<p class="h4">Are you sure you want to clear all order items?</p>',headerType:St.Warning}}).afterClosed().pipe(P(t=>t)).subscribe(()=>{this.cartItemEvent.next({action:"CLEAR"})})}onPurchaseItem(t){this.cartItemEvent.next({action:"PURCHASE",item:t.cartItem,index:t.index})}onReturnItem(t){this.cartItemEvent.next({action:"RETURN",item:t.cartItem,index:t.index})}getItemByVariantId(t){return this.httpService.get(L.GetVariantByID,[{key:"ID",value:t},{key:"EntityID",value:this.storeService.outlet().ID}]).pipe(st(e=>this.factoryService.generateCartItem(e)))}getItemByVariantByCode(t){return this.httpService.get(L.GetVariantByCode,[{key:"Code",value:t},{key:"EntityID",value:this.storeService.outlet().ID},{key:"Promotion",value:!0}]).pipe(st(e=>this.factoryService.generateCartItem(e)))}getVariantInventory(t){return this.httpService.get(L.GetVariantStockByID,[{key:"EntityID",value:this.storeService.outlet().ID},{key:"ID",value:t}])}validatePriceMinimum(t,e){let i=!0,o=this.userRoleService.Data.PriceMinimum,l=e().ModuleSell.ProductDialog.PriceMinimumTypeID;if(o){let h=0;switch(l){case 1:h=t.UnitPrice;break;case 2:h=t.UnitCost;break;case 3:h=t.UnitPriceMinimum;break}if(t.Price<h){i=!1;let D=g.StringFormat("<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Cannot sell lower than <h5 class='d-inline m-0'>{0}</h5></span>",this.decimalPipe.transform(h));this.priceMinimumRestrictionWarning.set(D)}else i=!0,this.priceMinimumRestrictionWarning.set("")}return i}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};function en(n,t){if(n&1&&(r(0,"td",8),s(1),a()),n&2){let e=m().$index;c(),x(" ",e+1,". ")}}function nn(n,t){if(n&1&&(r(0,"div",11),S(1,"img",31),a()),n&2){let e=m().$implicit;c(),u("src",e.ThumbnailUrl,Gt)}}function on(n,t){n&1&&(r(0,"div",12),S(1,"i",32),a())}function rn(n,t){if(n&1&&S(0,"small",16),n&2){let e=m().$implicit;u("innerHtml",e.Note,zt)}}function an(n,t){if(n&1&&(r(0,"span",20),s(1),v(2,"number"),a()),n&2){let e=m().$implicit;c(),R(Te(2,1,e.Quantity,"1.0-4"))}}function ln(n,t){if(n&1&&(r(0,"span",33),s(1,"x"),a(),r(2,"div",34)(3,"span",35),s(4),v(5,"number"),a()()),n&2){let e=m().$implicit;c(4),R(y(5,1,e.UnitQuantity))}}function cn(n,t){if(n&1&&(r(0,"span",21),s(1),v(2,"number"),a()),n&2){let e=m().$implicit;c(),x("@",y(2,1,e.VariantUnitQuantity))}}function sn(n,t){if(n&1&&(r(0,"small",22),s(1),a()),n&2){let e=m().$implicit;c(),R(e.UOM?e==null?null:e.UOMName:"")}}function mn(n,t){if(n&1&&(r(0,"div",24),s(1),v(2,"number"),a()),n&2){let e=m().$implicit;c(),x(" ",Te(2,1,e.Price,"1.0-4")," ")}}function pn(n,t){if(n&1){let e=F();r(0,"tr",7),d("contextmenu",function(o){let l=b(e),h=l.$implicit,D=l.$index,W=m(2);return _(W.onContextMenu(o,h,D))}),C(1,en,2,1,"td",8),r(2,"td",9),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(3,"div",10),C(4,nn,2,1,"div",11)(5,on,2,0,"div",12),r(6,"div",13)(7,"div"),s(8),a(),r(9,"span",14),s(10),a(),r(11,"div"),S(12,"app-serial-note",15),a(),C(13,rn,1,1,"small",16),a()()(),r(14,"td",17),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(15,"div",18)(16,"div",19),C(17,an,3,4,"span",20),C(18,ln,6,3),C(19,cn,3,3,"span",21),C(20,sn,2,1,"small",22),a()()(),r(21,"td",23),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),C(22,mn,3,4,"div",24),a(),r(23,"td",23),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(24,"div",25),s(25),v(26,"number"),a()(),r(27,"td",26),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(28,"div",18)(29,"div",20),s(30),v(31,"number"),a()()(),r(32,"td",27)(33,"div",28)(34,"span",29),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onRemove(l,h))}),S(35,"i",30),a()()()()}if(n&2){let e=t.$implicit,i=m(2);c(),f(i.appConfig!=null&&i.appConfig.ModuleSell.Grid.RowNumberVisible?1:-1),c(3),f(e.ThumbnailUrl?4:5),c(4),R(e.Name),c(2),R(e.Code),c(2),u("serials",e==null?null:e.Serial),c(),f(e.Note?13:-1),c(4),f(e.Quantity!==1&&e.Quantity!==0||e.UnitQuantity>1||e.VariantUnitQuantity>1?17:-1),c(),f(e.UnitQuantity>1?18:-1),c(),f(e.VariantUnitQuantity>1?19:-1),c(),f(e.UOM&&(!(i.appConfig==null||i.appConfig.ModuleSell==null)&&i.appConfig.ModuleSell.Grid.UOMVisible)?20:-1),c(2),f(e.Price!==e.Total?22:-1),c(3),x(" ",e.Discount?y(26,13,e.Discount*-1)+"%":""," "),c(5),x(" ",i.roleService.product!=null&&i.roleService.product.Price?y(31,15,e.Total):" - "," ")}}function dn(n,t){if(n&1){let e=F();r(0,"table",1)(1,"tbody",5),d("cdkDropListDropped",function(o){b(e);let l=m();return _(l.onDrop(o))}),pt(2,pn,36,17,"tr",6,mt),a()()}if(n&2){let e=m();c(2),dt(e.cartItems)}}function un(n,t){n&1&&(r(0,"div",2)(1,"div",36)(2,"div",37)(3,"div",38)(4,"div",39),S(5,"i",40),a(),r(6,"div",41)(7,"span"),s(8,"Empty Cart"),a(),S(9,"br"),r(10,"span"),s(11,"Add products to the cart"),a(),S(12,"br"),r(13,"span"),s(14,"or scan barcode"),a()()()()()())}function gn(n,t){if(n&1){let e=F();r(0,"button",42),d("click",function(){let o=b(e).item,l=m();return _(l.onReverse(o,!0))}),s(1,"Return"),a(),r(2,"button",42),d("click",function(){let o=b(e).item,l=m();return _(l.onReverse(o,!1))}),s(3,"Purchase"),a()}}var be=class n{roleService=p(Ct);appConfig;cartItems=[];set _cartItems(t){t&&(this.cartItems=[...t])}onRemoveEvent=new V;onEditEvent=new V;onDropItems=new V;onReturnEvent=new V;onPurchaseEvent=new V;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(t,e,i){t.preventDefault(),this.contextMenuPosition.x=t.clientX+"px",this.contextMenuPosition.y=t.clientY+"px",e.Index=i,this.contextMenu.menuData={item:e},this.contextMenu.openMenu()}onDrop(t){ti(this.cartItems,t.previousIndex,t.currentIndex),this.onDropItems.emit(this.cartItems)}onEdit(t,e){this.onEditEvent.emit({cartItem:t,index:e})}onRemove(t,e){this.onRemoveEvent.emit({cartItem:t,index:e})}onReverse(t,e){let i=t.Index;e?(t.Quantity>0&&(t.Quantity=t.Quantity*-1),this.onReturnEvent.emit({cartItem:t,index:i})):(t.Quantity<0&&(t.Quantity=t.Quantity*-1),this.onPurchaseEvent.emit({cartItem:t,index:i}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-cart-display"]],viewQuery:function(e,i){if(e&1&&qe(ae,7),e&2){let o;He(o=ze())&&(i.contextMenu=o.first)}},inputs:{appConfig:"appConfig",_cartItems:[0,"cartItems","_cartItems"]},outputs:{onRemoveEvent:"onRemove",onEditEvent:"onEdit",onDropItems:"onDropItems",onReturnEvent:"onReturn",onPurchaseEvent:"onPurchase"},decls:6,vars:6,consts:[["contextMenu","matMenu"],[1,"table","table-borderless"],[1,"row","g-0","h-100"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",1,"border-bottom"],["cdkDrag","",1,"border-bottom",3,"contextmenu"],[2,"width","10px"],[1,"pe-0",2,"width","50%",3,"click"],[1,"d-flex","align-items-center"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"d-block","ms-4",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%",3,"click"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[1,"fs-5"],["title","Variant Unit Quantity",1,"fs-5"],["title","UOM",1,"ps-1","fs-5"],[3,"click"],[1,"fs-5","text-end"],[1,"fw-normal","fs-5","text-danger"],[1,"pe-0",3,"click"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6","me-1","ms-1"],[1,"d-flex","algin-items-center"],["title","Unit Quantity",1,"fs-5","me-1"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"],["mat-menu-item","",3,"click"]],template:function(e,i){if(e&1&&(C(0,dn,4,0,"table",1)(1,un,15,0,"div",2),S(2,"div",3),r(3,"mat-menu",null,0),We(5,gn,4,0,"ng-template",4),a()),e&2){let o=Kt(4);f(i.cartItems.length>0?0:1),c(2),Ge("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),u("matMenuTriggerFor",o)}},dependencies:[A,ni,ii,ei,Oi,hi,vi,_i,fi,bi,ae,z],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc}.table[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(caption) > *[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:12px 10px} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.empty-cart-description[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#c7c7c7}"]})};var fn=(n,t)=>({"text-danger":n,"text-custom-warning":t});function bn(n,t){if(n&1&&(r(0,"mat-option",5)(1,"div",7)(2,"div",8)(3,"div"),s(4),a()()()()),n&2){let e=t.$implicit,i=m();u("value",e),c(2),u("ngClass",Je(4,fn,e.StateID==i.customerState.Suspended,e.StateID==i.customerState.WaitingForApproval))("title",e.StateID==i.customerState.Suspended?"Suspended":e.StateID==i.customerState.WaitingForApproval?"Waiting for Approval":""),c(2),R(e==null?null:e.Value)}}function _n(n,t){if(n&1){let e=F();r(0,"i",9),d("click",function(){b(e);let o=m();return _(o.openCustomerDetail())}),a()}}var _e=class n{httpService=p(J);router=p(Et);customerCtrl=new Ot;customerFiltered$=this.customerCtrl.valueChanges.pipe(P(t=>typeof t=="string"&&t.length>=3),Fe(300),K(t=>this.getCustomerSuggestion(t)));customerSelected$=this.customerCtrl.valueChanges.pipe(P(t=>typeof t!="string"),O(t=>{this.onChange(t)}));createNewCustomer=new V;clickInput=new V;customerState=Di;constructor(){this.customerSelected$.pipe(k()).subscribe()}getCustomerSuggestion(t){return this.httpService.get(L.GetCustomerSuggestions,[{key:"count",value:100},{key:"prefix",value:t}])}displayFn(t){return t?.Value}onCreateCustomer(){this.createNewCustomer.emit()}onClickInputValue(){this.clickInput.emit()}onChange=t=>{};onTouched=()=>{};writeValue(t){this.customerCtrl.patchValue(t,{onlySelf:!0,emitEvent:!1})}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}openCustomerDetail(){let t=this.customerCtrl.value.Key;if(g.IsNotEmpty(t)){let e=this.router.serializeUrl(this.router.createUrlTree(["/menu/Contacts/Contact/Customers/Info"],{queryParams:{ID:t}}));window.open(e,"_blank")}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-customer-autocomplete"]],outputs:{createNewCustomer:"onCreateNewCustomer",clickInput:"onClickInput"},features:[Mt([{provide:ee,multi:!0,useExisting:n}])],decls:9,vars:6,consts:[["auto","matAutocomplete"],[1,"d-flex","align-items-center","position-relative"],["matTooltipPosition","above","matTooltip","New Customer","role","button",1,"fa-light","fa-user-plus","position-absolute","cursor-pointer",2,"font-size","12px",3,"click"],["type","text","placeholder","Assign Customer",3,"click","formControl","matAutocomplete"],[3,"displayWith"],[3,"value"],["matTooltipPosition","left","matTooltip","Open Customer Details",1,"fa-regular","fa-arrow-up-right-from-square","position-absolute"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break",3,"ngClass","title"],["matTooltipPosition","left","matTooltip","Open Customer Details",1,"fa-regular","fa-arrow-up-right-from-square","position-absolute",3,"click"]],template:function(e,i){if(e&1&&(r(0,"div",1)(1,"i",2),d("click",function(){return i.onCreateCustomer()}),a(),r(2,"input",3),d("click",function(){return i.onClickInputValue()}),a(),r(3,"mat-autocomplete",4,0),pt(5,bn,5,7,"mat-option",5,mt),v(7,"async"),a(),C(8,_n,1,0,"i",6),a()),e&2){let o=Kt(4);c(2),u("formControl",i.customerCtrl)("matAutocomplete",o),c(),u("displayWith",i.displayFn),c(2),dt(y(7,4,i.customerFiltered$)),c(3),f(i.customerCtrl&&(i.customerCtrl!=null&&i.customerCtrl.value)&&(!(i.customerCtrl==null||i.customerCtrl.value==null)&&i.customerCtrl.value.Key)?8:-1)}},dependencies:[A,Z,ci,ai,Ze,li,wt,tt,G,Tt,ne,ie,le,Pt],styles:["input[_ngcontent-%COMP%]{width:100%;height:38px!important;border-radius:.375rem;border:1px solid #ced4da;padding-left:32px;padding-right:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i.fa-user-plus[_ngcontent-%COMP%]{font-size:16px;top:12px;left:11px}.text-custom-warning[_ngcontent-%COMP%]{color:#ff7a00d6}i.fa-arrow-up-right-from-square[_ngcontent-%COMP%]{position:absolute;right:13px;top:50%;transform:translateY(-50%);font-size:12px;z-index:2;cursor:pointer}"]})};var Ht=class n{storeService=p(I);dialog=p(nt);httpService=p(J);createNewCustomer(){this.dialog.open(yi,{data:{options:this.storeService.loadForm()?.EstimateOptions,config:this.storeService.loadForm()?.AppConfigJSON?.ModuleContact,type:"customer",title:"New Customer Form"}}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{let e=new ot;e.Key=t.CustomerID,e.Value=t.ContactName,this.storeService.updateCustomer(e)})}onSelectCustomer(t){let e=this.storeService.outlet();this.httpService.get(L.GetCustomerPrivilegeByID,[{key:"ID",value:t.Key},{key:"EntityID",value:e.ID}]).pipe(Ve(()=>{let i=new ot;return this.storeService.updateCustomer(i),Ne})).subscribe(i=>{let o=JSON.parse(JSON.stringify(t));o.PricebookID=i.PricebookID,this.storeService.updateCustomer(o)})}onDeleteCustomer(){g.IsNotEmpty(this.storeService?.customer()?.Key)&&this.dialog.open(Ii,{data:{title:"Re-assign customer",message:"Are you sure to re-assign the customer?"}}).afterClosed().pipe(P(t=>t)).subscribe(()=>{let t=new ot;this.storeService.updateCustomer(t)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var ve=class n{clickEvent=new V;onClick(){this.clickEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-note-button"]],outputs:{clickEvent:"onClickEvent"},decls:2,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"]],template:function(e,i){e&1&&(X(0,"button",0),Dt("click",function(){return i.onClick()}),$e(1,"i",1),at())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function vn(n,t){if(n&1&&(X(0,"div"),s(1),v(2,"number"),at()),n&2){let e=m();c(),x(" ",y(2,1,e.totalAmount)," ")}}function hn(n,t){n&1&&s(0," - ")}var he=class n{payEvent=new V;totalItems=0;totalQuantity=0;totalAmount=0;rolePrice=!0;constructor(){}ngOnInit(){}onPay(){this.payEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-pay-button"]],inputs:{totalItems:"totalItems",totalQuantity:"totalQuantity",totalAmount:"totalAmount",rolePrice:"rolePrice"},outputs:{payEvent:"onPayEvent"},decls:10,vars:5,consts:[["type","button",1,"btn","btn-success","fs-1","py-4","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fs-6"]],template:function(e,i){e&1&&(X(0,"button",0),Dt("click",function(){return i.onPay()}),X(1,"div",1)(2,"div")(3,"span"),s(4,"Submit"),at(),X(5,"small",2),s(6),v(7,"number"),at()(),C(8,vn,3,3,"div")(9,hn,1,0),at()()),e&2&&(c(6),xt(" (",y(7,3,i.totalItems)," Items & ",i.totalQuantity," Qty) "),c(2),f(i.rolePrice?8:9))},dependencies:[A,z],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0;position:relative;flex:1 1 auto;border-left:.1px solid #fff}"]})};var ye=class n{clickEvent=new V;onClick(){this.clickEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-discount-button"]],outputs:{clickEvent:"onClickEvent"},decls:2,vars:0,consts:[["type","button","matTooltip","Discount / Tax","matTooltipPosition","above",1,"btn","btn-success","fs-5",3,"click"],[1,"fa-light","fa-percent"]],template:function(e,i){e&1&&(r(0,"button",0),d("click",function(){return i.onClick()}),S(1,"i",1),a())},dependencies:[ne,ie],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;border-top-right-radius:0;border-bottom-right-radius:0;position:relative;flex:1 1 auto}"]})};var Ut=class n{store=p(I);toastr=p(te);dialog=p(nt);_backEndService=p(mi);updateState$=B(this.store.complete).pipe(P(t=>t.Success),O(()=>this.store.updateState(3)),k());constructor(){this.updateState$.subscribe()}onPay(){if(this.validatePayOrder()==!1)return;let e={Items:this.cartItemPreSubmission(),Order:N({},this.store.order())};this._backEndService.submitTransaction(e,L.SubmitEstimate).subscribe(i=>{this.store.updateComplete(i)})}cartItemPreSubmission(){let t=JSON.parse(JSON.stringify(this.store.cartItems()));return t=t.map(e=>(delete e.Variant,e)),t}validatePayOrder(){let t=!0;return g.IsEmpty(this.store.outlet().ID)&&(this.toastr.error("Please select outlet before proceeding..",St.Error),t=!1),g.IsEmpty(this.store.customer().Key)&&(this.toastr.warning("Please select a customer!",St.Warning),t=!1),this.store.cartItems().length==0&&(this.toastr.error("You must have at least one item.",St.Error),t=!1),g.IsEmpty(this.store.order().Number)&&(this.toastr.error("Number cannot be empty.",St.Error),t=!1),t}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var xe=class n{constructor(t,e){this.dialogRef=e;this.discountAmount.set(t.discountAmount),this.discount.set(t.discount),this.tax=w(t.tax),this.currency=w(t.currency),this.taxes.set(t.taxes),this.initModalConfig()}modalConfig=new kt;discountAmount=w(0);discount=w(0);tax;discounts=w([0,0,0]);currency;taxes=w([]);initModalConfig(){this.modalConfig.title="Discount and Tax",this.modalConfig.customWidth="400px"}onClose(){this.dialogRef.close()}onSave(){this.dialogRef.close({discountAmount:this.discountAmount(),discount:this.discount(),tax:this.tax()})}onSelectTax(t){this.tax.set(t)}onDiscountCalculatorChange(t,e){let i=this.discounts();i[e]=t,this.discounts.set(i),this.calculateDiscountCalculator()}calculateDiscountCalculator(){let t=this.discounts(),e=100;t.forEach(o=>{o&&o>0&&(e=e*(100-o)/100)});let i=100-e;this.discount.set(i)}static \u0275fac=function(e){return new(e||n)(Y(Vt),Y(At))};static \u0275cmp=M({type:n,selectors:[["app-dialog-discount"]],decls:48,vars:10,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["matTooltipPosition","above","matTooltip","Discount","tabTitle","Discount"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-3"],[1,"fw-bold","d-block"],[1,"col-9"],["type","text","data-cy","discount1","autoNum","","percentage","","decimalPlaces","2",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","ngModel"],[1,"ms-1"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],["type","text","data-cy","discountamount","autoNum","",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Tax","tabTitle","Tax"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","Tax",2,"width","150px",3,"change","clearable","ngModel","items"],["matTooltipPosition","above","matTooltip","Calculation","tabTitle","Calculator"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-4"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"mx-2"],["type","text","data-cy","discountCal2","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),d("keydown.F2",function(){return i.onSave()})("onOk",function(){return i.onSave()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs"),ut(4),r(5,"tab",2)(6,"div",3)(7,"div",4)(8,"label",5),s(9,"Discount %"),a()(),r(10,"div",6)(11,"input",7),Q("ngModelChange",function(l){return j(i.discount,l)||(i.discount=l),l}),a(),r(12,"span",8),s(13,"%"),a()()(),r(14,"div",9)(15,"div",4)(16,"label",5),s(17),a()(),r(18,"div",6)(19,"input",10),Q("ngModelChange",function(l){return j(i.discountAmount,l)||(i.discountAmount=l),l}),a()()()(),gt(),ut(20),r(21,"tab",11)(22,"div",3)(23,"div",4)(24,"label",5),s(25,"Tax"),a()(),r(26,"div",6)(27,"ng-select",12),d("change",function(l){return i.onSelectTax(l)}),a()()()(),gt(),ut(28),r(29,"tab",13)(30,"div",14)(31,"div",15)(32,"label",5),s(33,"Discount Calculator"),a()(),r(34,"div",16)(35,"input",17),d("ngModelChange",function(l){return i.onDiscountCalculatorChange(l,0)}),a(),r(36,"span"),s(37," %"),a(),r(38,"span",18),s(39,"+"),a(),r(40,"input",19),d("ngModelChange",function(l){return i.onDiscountCalculatorChange(l,1)}),a(),r(41,"span"),s(42," %"),a(),r(43,"span",18),s(44,"+"),a(),r(45,"input",20),d("ngModelChange",function(l){return i.onDiscountCalculatorChange(l,2)}),a(),r(46,"span"),s(47," %"),a()()()(),gt(),a()()()()),e&2){let o;u("config",i.modalConfig),c(11),U("ngModel",i.discount),c(6),x("Discount ",(o=i.currency())==null?null:o.Symbol),c(2),U("ngModel",i.discountAmount),c(8),u("clearable",!1)("ngModel",i.tax().ID)("items",i.taxes()),c(8),u("ngModel",i.discounts[0]),c(5),u("ngModel",i.discounts[1]),c(5),u("ngModel",i.discounts[2])}},dependencies:[A,Nt,ce,me,se,it,tt,G,et,Ft,ft],encapsulation:2})};var yt=class n{storeService=p(I);totalItemsQty=q(()=>this.storeService.cartItems().reduce((i,o)=>i+o.Quantity,0));totalItemsAmount=q(()=>this.storeService.cartItems().reduce((i,o)=>i+o.Total,0));taxAmount=q(()=>{let t=this.storeService.tax(),e=0;return t.Rate>0&&(t.CalculationTypeID==1?e=this.calculateTaxInclude(t):e=this.calculateTaxAdd(t)),e});totalAmount=q(()=>{let t=this.storeService.tax(),e=this.storeService.order().DiscountAmount,i=this.storeService.order().Discount,o=this.totalItemsAmount(),l=this.calculatePercentagDisc(i,o),h=o-e-l;return t.CalculationTypeID==0&&(h=h+this.taxAmount()),h});discountPercentageAmount=q(()=>{let t=this.storeService.order().Discount,e=this.totalItemsAmount();return this.calculatePercentagDisc(t,e)});calculateTaxInclude(t){let e=this.grossTotalTaxable();return t.Rate/(100+t.Rate)*e}calculateTaxAdd(t){let e=this.grossTotalTaxable();return t.Rate/100*e}grossTotalTaxable(){let t=this.taxableItems(),e=this.calculateTaxableItemsPrice(),i=this.storeService.discount();if(t.length!==0){let o=this.calculateDiscountTaxableItem();e=e*(100-i.discount)/100,e=e-o}return e}calculateDiscountTaxableItem(){let t=this.taxableItems(),e=this.totalItemsAmount(),i=this.storeService.discount().discountAmount,o=0,l=0,h=0,D=0;for(let W of t)o=W.getItemAfterDiscount/e,l=o*i,D=l*W.Quantity,h+=D;return h}calculatePercentagDisc(t,e){return t/100*e}calculateTaxableItemsPrice(){return this.taxableItems().filter(i=>i.Taxable).reduce((i,o)=>i+o.Total,0)}taxableItems(){return this.storeService.cartItems().filter(e=>e.Taxable)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Sn=n=>({selected:n});function In(n,t){if(n&1){let e=F();r(0,"div",9)(1,"span",14),s(2,"@"),a(),r(3,"input",15),Q("ngModelChange",function(o){b(e);let l=m();return j(l.currency().ExchangeRate,o)||(l.currency().ExchangeRate=o),_(o)}),a()()}if(n&2){let e=m();c(3),U("ngModel",e.currency().ExchangeRate)}}function Dn(n,t){if(n&1){let e=F();r(0,"div",13)(1,"label",16)(2,"input",17),d("ngModelChange",function(){let o=b(e).$implicit,l=m();return _(l.onChangeTag(o.ID))}),a(),s(3),a()()}if(n&2){let e,i=t.$implicit,o=t.$index,l=m();c(),u("for",Oe("potype-"+o))("ngClass",$(7,Sn,((e=l.tag())==null?null:e.ID)==i.ID)),c(),u("id",Oe("potype-"+o))("ngModel",l.tag().ID),c(),x(" ",i.Name," ")}}var Se=class n{constructor(t,e){this.dialogRef=e;this.initModalConfig(),this.currencies.set(t.currencies),this.note.set(t.note),this.tags.set(t.tags),this.tag=w(t.tag),this.currency=w(t.currency),this.defaultCurrencyId=w(t.defaultCurrencyId)}modalConfig=new kt;currencies=w([]);tags=w([]);tag;currency;defaultCurrencyId;note=w("");initModalConfig(){this.modalConfig.title="Order Note",this.modalConfig.customWidth="700px"}onChangeCurrency(t){let e=this.currencies()?.find(i=>i.ID===t);this.currency.set(e)}onChangeTag(t){let e=this.tags()?.find(i=>i.ID===t);this.tag.set(e)}onClose(){this.dialogRef.close()}onSave(){this.dialogRef.close({currency:this.currency(),tag:this.tag(),note:this.note()})}static \u0275fac=function(e){return new(e||n)(Y(Vt),Y(At))};static \u0275cmp=M({type:n,selectors:[["app-dialog-note"]],decls:20,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["matTooltipPosition","above","matTooltip","Notes","tabTitle","Notes"],[3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Currency","tabTitle","Currency"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],[1,"row","ms-4"],[1,"ps-0","col-sm-4"],["bindLabel","Name","bindValue","ID","placeholder","Currency","appendTo","body",3,"ngModelChange","items","clearable","ngModel"],[1,"col-sm-4","d-flex"],["matTooltipPosition","above","matTooltip","Tag","tabTitle","Tag"],[1,"row"],[1,"col-12"],[1,"rad-btn"],[1,"pt-4"],["type","text","autoNum","",1,"border","border-light",3,"ngModelChange","ngModel"],[3,"for","ngClass"],["type","radio",3,"ngModelChange","ngModel","id"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),d("keydown.F2",function(){return i.onSave()})("onOk",function(){return i.onSave()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs"),ut(4),r(5,"tab",2)(6,"POS-tinymce-editor",3),Q("ngModelChange",function(l){return j(i.note,l)||(i.note=l),l}),a()(),gt(),ut(7),r(8,"tab",4)(9,"div",5)(10,"div",6)(11,"div",7)(12,"ng-select",8),d("ngModelChange",function(l){return i.onChangeCurrency(l)}),a()(),C(13,In,4,1,"div",9),a()()(),gt(),ut(14),r(15,"tab",10)(16,"div",11)(17,"div",12),pt(18,Dn,4,9,"div",13,mt),a()()(),gt(),a()()()()),e&2){let o;u("config",i.modalConfig),c(6),U("ngModel",i.note),c(6),u("items",i.currencies())("clearable",!1)("ngModel",i.currency().ID),c(),f(((o=i.currency())==null?null:o.ID)!=i.defaultCurrencyId()?13:-1),c(5),dt(i.tags())}},dependencies:[A,Z,Nt,ce,me,se,it,tt,Ye,G,et,Ft,ft,re],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}"]})};var Ie=class n{onClickEvent=new V;constructor(){}ngOnInit(){}onClick(){this.onClickEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-clear-button"]],outputs:{onClickEvent:"onClickEvent"},decls:3,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"]],template:function(e,i){e&1&&(X(0,"button",0),Dt("click",function(){return i.onClick()}),X(1,"span"),s(2,"Clear"),at()())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function Mn(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2,"Amount"),a(),r(3,"td",12),s(4),v(5,"number"),a()()),n&2){let e=m();c(4),R(y(5,1,e.calculationService==null?null:e.calculationService.totalItemsAmount()))}}function Pn(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2),a(),r(3,"td",13),s(4),v(5,"number"),a()()),n&2){let e=m(2);c(2),x("Discount ",e.storeService==null?null:e.storeService.discount().discount,"%"),c(2),x(" ",y(5,2,e.calculationService.discountPercentageAmount()*-1))}}function En(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2),a(),r(3,"td",13),s(4),v(5,"number"),a()()),n&2){let e,i,o=m(2);c(2),x("Discount ",(e=o.storeService.currency())==null?null:e.Symbol),c(2),x(" ",y(5,2,((i=o.storeService.discount())==null?null:i.discountAmount)*-1))}}function On(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2),a(),r(3,"td",12),s(4),v(5,"number"),a()()),n&2){let e,i=m(2);c(2),R((e=i.storeService.tax())==null?null:e.Label),c(2),R(y(5,2,i.calculationService.taxAmount()))}}function Tn(n,t){if(n&1&&(C(0,Pn,6,4,"tr"),C(1,En,6,4,"tr"),C(2,On,6,4,"tr")),n&2){let e,i,o=m();f(o.storeService.discount().discount!=0?0:-1),c(),f(((e=o.storeService.discount())==null?null:e.discountAmount)!=0?1:-1),c(),f(((i=o.storeService.tax())==null?null:i.Rate)!=0?2:-1)}}var De=class n{storeService=p(I);orderService=p(lt);roleService=p(Ct);payService=p(Ut);calculationService=p(yt);cartService=p(ct);dialog=p(nt);taxCalculationType=oe;totalItemsQty=q(()=>this.storeService.cartItems()?.length);isShowAmount=q(()=>this.storeService?.tax()?.CalculationTypeID==0&&this.storeService?.tax()?.Rate||this.storeService.discount()?.discount!=0||this.storeService.discount()?.discountAmount!=0);onOpenDialogNote(){this.dialog.open(Se,{data:{tags:this.storeService.loadForm().SalesOrderTags,currencies:this.storeService.loadForm().Currencies,currency:this.storeService.currency(),tag:this.storeService.tag(),defaultCurrencyId:this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID,note:this.storeService.order().Note}}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{this.storeService.updateCurrency(t.currency),this.storeService.updateTag(t.tag),this.storeService.updateOrder(jt(N({},this.storeService.order()),{Note:t.note}))})}onOpenDialogDiscount(){this.dialog.open(xe,{data:{discountAmount:this.storeService.order().DiscountAmount,discount:this.storeService.order().Discount,tax:this.storeService.tax(),currency:this.storeService.currency(),taxes:this.storeService.loadForm().Taxes}}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{this.storeService.updateDiscount({discountAmount:t.discountAmount,discount:t.discount}),this.storeService.updateTax(t.tax)})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-cart-action"]],decls:13,vars:6,consts:[[1,"row","g-0","px-5","justify-content-end"],[1,"col-6",2,"padding-right","15px"],[1,"table","table-borderless"],[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[2,"flex-grow","1",3,"onClickEvent"],[2,"flex-grow","3",3,"onClickEvent"],[1,"col-7"],[1,"btn-group","w-100"],[1,"d-inline-flex",3,"onClickEvent"],[1,"d-inline-flex","w-100",3,"onPayEvent","rolePrice","totalQuantity","totalItems","totalAmount"],[1,"text-start"],[1,"text-end","fs-5"],[1,"text-end","fs-5","text-danger"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"table",2),C(3,Mn,6,3,"tr"),C(4,Tn,3,3),a()()(),r(5,"div",3)(6,"div",4)(7,"app-note-button",5),d("onClickEvent",function(){return i.onOpenDialogNote()}),a(),r(8,"app-clear-button",6),d("onClickEvent",function(){return i.cartService.clearCart()}),a()(),r(9,"div",7)(10,"div",8)(11,"app-discount-button",9),d("onClickEvent",function(){return i.onOpenDialogDiscount()}),a(),r(12,"app-pay-button",10),d("onPayEvent",function(){return i.payService.onPay()}),a()()()()),e&2&&(c(3),f(i.isShowAmount()?3:-1),c(),f(i.calculationService.totalItemsQty()>0?4:-1),c(8),u("rolePrice",i.roleService.product.Price)("totalQuantity",i.calculationService.totalItemsQty())("totalItems",i.totalItemsQty())("totalAmount",i.calculationService.totalAmount()))},dependencies:[A,ye,ve,he,Ie,z],encapsulation:2})};var Vi=n=>({ID:n}),wn=()=>["/menu/Orders/Orders/Estimate/Info"],kn=n=>({"border-top":n});function Nn(n,t){if(n&1&&(r(0,"div",23)(1,"div",28),s(2),a(),r(3,"div",28),s(4),v(5,"number"),a()()),n&2){let e=t.$implicit;c(2),R(e.Name),c(2),x("",y(5,2,e.Total)," ")}}function An(n,t){if(n&1&&(r(0,"div",24)(1,"div",29),s(2),a(),r(3,"div",29),s(4),v(5,"number"),a()()),n&2){let e,i=m();c(2),x("Amount: ",(e=i.storeService.currency())==null?null:e.Symbol),c(2),R(y(5,2,i.calculationService.totalItemsAmount()))}}function Vn(n,t){if(n&1&&(r(0,"div",25)(1,"div",29),s(2),v(3,"number"),a(),r(4,"div",30),s(5),v(6,"number"),a()()),n&2){let e,i=m();c(2),xt("","Discount "+y(3,3,(e=i.storeService.discount())==null?null:e.discount)+" %",": ",(e=i.storeService.currency())==null?null:e.Symbol),c(3),R(y(6,5,i.calculationService.discountPercentageAmount()*-1))}}function Fn(n,t){if(n&1&&(r(0,"div",25)(1,"div",29),s(2),a(),r(3,"div",30),s(4),v(5,"number"),a()()),n&2){let e,i,o=m();c(2),x("Discount: ",(e=o.storeService.currency())==null?null:e.Symbol),c(2),x("",y(5,2,((i=o.storeService.discount())==null?null:i.discountAmount)*-1)," ")}}function Rn(n,t){if(n&1&&(r(0,"div",25)(1,"div",29),s(2),a(),r(3,"div",29),s(4),v(5,"number"),a()()),n&2){let e,i=m();c(2),xt("",(e=i.storeService.tax())==null?null:e.Label,": ",(e=i.storeService.currency())==null?null:e.Symbol),c(2),R(y(5,3,i.calculationService.taxAmount()))}}var Me=class n{orderService=p(lt);calculationService=p(yt);storeService=p(I);isShowAmount=q(()=>this.storeService?.tax()?.CalculationTypeID==0&&this.storeService?.tax()?.Rate||this.storeService.discount()?.discount!=0||this.storeService.discount()?.discountAmount!=0);handleF8(){this.orderService.newOrder()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-complete"]],hostBindings:function(e,i){e&1&&d("keydown.F8",function(){return i.handleF8()},Jt)},decls:41,vars:20,consts:[[1,"pt-7",2,"border-bottom","1px solid rgba(0, 0, 0, 0.1)"],[1,"ps-7","fw-normal","pb-9"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body"],[1,"row",2,"height","115px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","my-6"],["target","_blank","routerLink","/print/Estimate",1,"btn","bg-light-gray","btn-secondary",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body","py-4"],[1,"row","justify-content-between","border-bottom","py-2"],[1,"row","justify-content-end","mt-2","pb-2"],[1,"row","justify-content-end","pb-2"],[1,"row","justify-content-end","pt-4",3,"ngClass"],[1,"col-4","text-end","h5"],[1,"col","text-end"],[1,"col-4","text-end"],[1,"col-4","text-end","text-danger"]],template:function(e,i){if(e&1&&(r(0,"div",0)(1,"h1",1),s(2,"Estimate"),a()(),r(3,"section",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h1",8),S(10,"i",9),s(11,"Order Complete "),a()(),r(12,"div",10)(13,"div",11)(14,"div",12)(15,"a",13),d("click",function(){return i.orderService.newOrder()}),s(16,"New Order (F8)"),a()()()(),r(17,"div",14)(18,"div",15)(19,"a",16),S(20,"i",17),s(21,"Print Receipt"),a()()()()(),r(22,"div",18)(23,"div",6)(24,"div",19)(25,"h3",20)(26,"a",21),s(27),a()()(),r(28,"div",22),pt(29,Nn,6,4,"div",23,mt),C(31,An,6,4,"div",24),C(32,Vn,7,7,"div",25),C(33,Fn,6,4,"div",25),C(34,Rn,6,5,"div",25),r(35,"div",26)(36,"div",27),s(37),a(),r(38,"div",27),s(39),v(40,"number"),a()()()()()()()()),e&2){let o,l,h,D,W;c(19),u("queryParams",$(13,Vi,i.storeService.complete().OrderID)),c(7),u("routerLink",Yt(15,wn))("queryParams",$(16,Vi,i.storeService.complete().OrderID)),c(),x("Estimate #",(o=i.storeService.complete())==null?null:o.InvoiceNumber),c(2),dt(i.storeService.cartItems()),c(2),f(i.isShowAmount()?31:-1),c(),f(((l=i.storeService.discount())==null?null:l.discount)>0?32:-1),c(),f(((h=i.storeService.discount())==null?null:h.discountAmount)>0?33:-1),c(),f(((D=i.storeService.tax())==null?null:D.Rate)>0?34:-1),c(),u("ngClass",$(18,kn,i.isShowAmount())),c(2),x("Total: ",(W=i.storeService.currency())==null?null:W.Symbol),c(2),R(y(40,11,i.calculationService.totalAmount()))}},dependencies:[A,Z,Zt,Xt,si,z],styles:[".order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}"]})};var Pe=class n{route=p(Et);dialog=p(nt);addItem=new V;handleF8(){this.dialog.openDialogs&&this.dialog.openDialogs.length>0||this.onAddItem()}onAddItem(){this.addItem.emit()}redirectToPrevious(){this.route.navigate(["/menu/Estimate/V1"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-more-action"]],hostBindings:function(e,i){e&1&&d("keydown.F4",function(){return i.handleF8()},Jt)},outputs:{addItem:"onAddItem"},decls:14,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer",3,"click"],["icon","fa-circle-plus fa-solid","label","Add New"]],template:function(e,i){e&1&&(r(0,"span",0)(1,"span",1),S(2,"i",2),a(),r(3,"span",3),s(4,"More Actions"),a()(),r(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"Item"),a(),S(11,"div",9),r(12,"li",10),d("click",function(){return i.onAddItem()}),S(13,"POS-dropdown-item-more-action",11),a()()()()())},dependencies:[Ti],encapsulation:2})};function Bn(n,t){n&1&&S(0,"POS-complete")}function Un(n,t){if(n&1){let e=F();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"POS-select-outlet-form",6),v(6,"async"),d("ngModelChange",function(o){b(e);let l=m();return _(l.outletService.updateOutlet(o))}),a()(),r(7,"POS-invoice-number-form",7),v(8,"async"),d("ngModelChange",function(o){b(e);let l=m();return _(l.orderService.updateOrderNumber(o))}),a(),r(9,"POS-invoice-date",8),d("ngModelChange",function(o){b(e);let l=m();return _(l.orderService.updateOrderDate(o))}),a()()(),r(10,"div",9)(11,"div",10)(12,"div",11)(13,"POS-more-action",12),d("onAddItem",function(){b(e);let o=m();return _(o.cartItemService.onOpenAddDialog())}),a()(),r(14,"div",13)(15,"ng-select-infinite",14,0),v(17,"async"),d("selectedChange",function(o){b(e);let l=m();return _(l.orderService.updateSalesPersonId(o))}),a()()()()(),r(18,"div",15)(19,"div",16)(20,"POS-quick-key",17),v(21,"async"),d("onSelectVariant",function(o){b(e);let l=m();return _(l.cartItemService.onSelectQuickkeyItem(o))}),a()(),r(22,"div",18)(23,"div",19)(24,"div",20),S(25,"POS-variant-autocomplete",21),a(),r(26,"div",13)(27,"POS-customer-autocomplete",22),d("onCreateNewCustomer",function(){b(e);let o=m();return _(o.customerService.createNewCustomer())})("ngModelChange",function(o){b(e);let l=m();return _(l.customerService.onSelectCustomer(o))})("onClickInput",function(){b(e);let o=m();return _(o.customerService.onDeleteCustomer())}),a()()(),r(28,"POS-cart-display",23),v(29,"async"),d("onRemove",function(o){b(e);let l=m();return _(l.cartItemService.removeCartItem(o))})("onEdit",function(o){b(e);let l=m();return _(l.cartItemService.onOpenEditDialog(o))})("onDropItems",function(o){b(e);let l=m();return _(l.cartItemService.onDropItems(o))})("onPurchase",function(o){b(e);let l=m();return _(l.cartItemService.onPurchaseItem(o))})("onReturn",function(o){b(e);let l=m();return _(l.cartItemService.onReturnItem(o))}),a(),S(30,"POS-cart-action"),a()()()}if(n&2){let e,i=m();c(5),u("ngModel",i.storeService.outlet())("outlets",i.storeService.loadForm().Entities)("isOpenAfterLoad",y(6,18,i.outletService.isOpenDialog$)),c(2),u("ngModel",y(8,20,i.orderService.orderNumber$))("isEdit",i.isEditOrder()),c(2),u("ngModel",i.storeService.order().Date)("disabled",!(!(i.role==null||i.role.global==null)&&i.role.global.Date))("tooltip",!(i.role==null||i.role.global==null)&&i.role.global.Date?"":"Date role is required"),c(6),u("clearable",!0)("optionTitle",!0)("items",y(17,22,i.orderService.salesPersons$))("selected",i.storeService.order().SalesID),c(5),u("quickKey",y(21,24,i.quickkeyService.quickkeys$))("outletID",i.storeService.outlet().ID),c(5),u("formControl",i.cartItemService.variantSearchCtrl),c(2),u("ngModel",i.storeService.customer()),c(),u("cartItems",y(29,26,i.cartItemService.cartItems$))("appConfig",(e=i.storeService.loadForm())==null?null:e.AppConfigJSON)}}var Fi=class n extends oi{loadFormService=p(Qt);storeService=p(I);role=p(Ct);outletService=p(Lt);orderService=p(lt);quickkeyService=p(Wt);cartItemService=p(ct);customerService=p(Ht);intercomService=p(Xe);destroyRef=p(je);isCompleteOrder=q(()=>this.storeService.state()==3);isEditOrder=q(()=>this.storeService.state()==1);constructor(t){super(t),this.menuData$.pipe(k(this.destroyRef)).subscribe(),this.intercomService.hideLauncher()}ngOnDestroy(){this.intercomService.showLauncher()}static \u0275fac=function(e){return new(e||n)(Y(ri))};static \u0275cmp=M({type:n,selectors:[["POS-estimate-v2"]],features:[Mt([I,Qt,Lt,lt,Wt,ct,Ht,Ut,yt,_t,ht]),Le],decls:2,vars:1,consts:[["ngSelectInfinite",""],[1,"container-fluid"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex"],[3,"ngModelChange","ngModel","outlets","isOpenAfterLoad"],["transactionType","Estimate",3,"ngModelChange","ngModel","isEdit"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],[3,"onAddItem"],[1,"col-5","ps-0"],["bindValue","ID","bindLabel","Name","placeholder","Assign Sales Person",1,"sales-person","select-max-width",3,"selectedChange","clearable","optionTitle","items","selected"],[1,"row","content"],[1,"col-5","border-end","pt-1"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7","pt-5","px-0","d-flex","flex-column"],[1,"row","w-100","ms-0"],[1,"col-7","px-0"],[3,"formControl"],[3,"onCreateNewCustomer","ngModelChange","onClickInput","ngModel"],[1,"cart-display",3,"onRemove","onEdit","onDropItems","onPurchase","onReturn","cartItems","appConfig"]],template:function(e,i){e&1&&C(0,Bn,1,0,"POS-complete")(1,Un,31,28,"div",1),e&2&&f(i.isCompleteOrder()?0:1)},dependencies:[A,Mi,wt,G,Tt,Pi,it,et,Ci,di,Ei,be,_e,le,pe,De,Me,Pe,Pt],styles:["ng-select-infinite.sales-person.select-max-width>ng-select{padding-right:10px;height:38px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container{font-size:.75rem;border:.5px solid #d7d7d7;padding-right:6px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container>.ng-arrow-wrapper{width:12px;padding-bottom:2px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container>.ng-value-container{padding-left:6px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container{min-height:38px!important;height:38px!important;border:none} ng-select-infinite.sales-person.select-max-width.offline>.ng-select.ng-select-single .ng-select-container{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container .ng-input{padding-left:5px!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container .ng-input>input{padding-top:5px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single>ng-dropdown-panel.ng-dropdown-panel{font-size:.75rem;width:95%!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-focused .ng-select-container{box-shadow:none!important;border-color:transparent!important}.left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media(max-width:990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}"],changeDetection:0})};export{Fi as EstimateV2Component};
1
+ import{a as ki}from"./chunk-V47BF5NR.js";import{a as Ei,e as Oi,f as Ti}from"./chunk-RRKYFJCV.js";import{a as pe}from"./chunk-YZTV3CZR.js";import{a as Mi}from"./chunk-EMQK4JF7.js";import{a as wi}from"./chunk-DU73NSE6.js";import{a as Pi}from"./chunk-JNZ42KTE.js";import"./chunk-UD2YNGJT.js";import{a as mi}from"./chunk-W52Y2CTX.js";import"./chunk-YGTSYNJ4.js";import{a as Di}from"./chunk-HBAQBI6Z.js";import{b as ui,c as gi}from"./chunk-SLDTP6YZ.js";import"./chunk-JP66BF4L.js";import{b as yi,c as le}from"./chunk-E6X2UHSN.js";import{a as Ii}from"./chunk-X4P6TIDV.js";import{a as oe}from"./chunk-46FATRR5.js";import{a as xi,b as Si}from"./chunk-WIODXTKB.js";import{a as fi,b as bi,c as _i,d as ae,e as vi}from"./chunk-LRGIUDMK.js";import"./chunk-NQX7EX5A.js";import"./chunk-SLAM367X.js";import{b as Ci}from"./chunk-CONGWQP2.js";import{a as ce,b as se,c as me}from"./chunk-7X4VZXLW.js";import"./chunk-UKRO3R7X.js";import{a as re}from"./chunk-XOJZGUT3.js";import{a as hi}from"./chunk-Z6DGFGP3.js";import"./chunk-7VUJP4ZL.js";import"./chunk-Z3E24JZW.js";import{c as pi}from"./chunk-NSNUUKNK.js";import"./chunk-DDLXGCOB.js";import{a as di}from"./chunk-XV3LZZ5N.js";import"./chunk-ZOY3GIWS.js";import"./chunk-CIDPGJ5I.js";import"./chunk-3XXHI4EL.js";import"./chunk-OFAMZL4W.js";import"./chunk-PRC6BIGW.js";import"./chunk-XRHB5YFU.js";import"./chunk-JGRL2V64.js";import"./chunk-77OYJ25Y.js";import"./chunk-IGAEFS7B.js";import"./chunk-4M7RPVWV.js";import"./chunk-5FZQUUGO.js";import{g as si}from"./chunk-STTYRDAE.js";import"./chunk-IEXCLXA2.js";import{a as ft}from"./chunk-7TPO6NBM.js";import{a as ti,d as ei,f as ii,h as ni}from"./chunk-NLFBNSNG.js";import"./chunk-QFFTSYQT.js";import{a as oi}from"./chunk-M42U7VID.js";import{a as ri}from"./chunk-ZEQ236EM.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import"./chunk-LZNSQRCR.js";import"./chunk-BCH2MDJT.js";import"./chunk-INL666X3.js";import{k as Ze,o as ai,q as li,r as ci}from"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import{a as ie,b as ne}from"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import{P as L}from"./chunk-5VLBYHUJ.js";import{d as Ft}from"./chunk-Q7OVBNEW.js";import"./chunk-V5VDOLOZ.js";import{a as At,b as Vt,c as nt}from"./chunk-6RFU4RXC.js";import{a as k,b as B}from"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import{a as St,b as kt,c as Nt}from"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import"./chunk-FMECWSCG.js";import{E as it,F as wt,a as ee,c as tt,h as G,l as Ot,o as et,r as Ye,s as Tt}from"./chunk-QMS2MBIA.js";import"./chunk-HM3ZQECL.js";import{a as Xe}from"./chunk-TA33BFJL.js";import"./chunk-WLVEHCCR.js";import{b as Ct}from"./chunk-P7GOTTNS.js";import{a as g}from"./chunk-3DEA4WWC.js";import"./chunk-PS3OAEKV.js";import{n as te,q as J}from"./chunk-3GXUD7K4.js";import{Ba as je,Bb as C,Bc as Mt,Ca as V,Cc as Yt,Db as f,Dc as $,E as Ae,Ec as Je,F as P,Fa as w,Fb as mt,Gb as pt,Hb as dt,Ib as u,J as Ve,Jb as r,Kb as a,Kc as v,Lb as S,Lc as y,Mb as X,Mc as Te,N as Fe,Nb as at,Ob as $e,Pb as ut,Qb as gt,R as Re,Rd as Ke,Sa as zt,T as Be,Tc as q,Td as Et,Ua as Gt,Ub as F,Ud as Xt,Wd as Zt,X as Ue,Xa as Jt,Xb as d,Yb as Dt,Z as It,Za as c,Zb as m,ba as K,bc as qe,cc as He,d as ke,dc as ze,eb as Y,ga as O,gb as Qe,hc as Kt,ib as M,ic as Ge,k as Ne,mc as s,md as Z,na as T,nb as Le,nc as R,o as Ee,ob as We,oc as x,pc as xt,ra as p,rc as U,sc as j,sd as Pt,tc as Q,u as st,va as b,wa as _,wd as z,xc as Oe,zd as A}from"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import{a as N,b as jt}from"./chunk-SNAKHGZS.js";var de=class{AppConfigJSON;Currencies;SalesOrderTags;Entities;Payments;Taxes;SalesPOTypes;EstimateOptions;Data};var Rt=class{CurrencyID;CustomerID;Date;Discount;DiscountAmount;EntityID;ID;Note;Number;SalesID;TaxTypeID;TypeID;constructor(){this.CustomerID=g.GuidEmpty,this.EntityID=g.GuidEmpty,this.ID=g.GuidEmpty,this.TaxTypeID=g.GuidEmpty,this.Discount=0,this.DiscountAmount=0,this.Date=new Date().toDateString(),this.Note=""}};var ot=class{Email;Key;Mobile;Name;Phone;Value;PricebookID;StateID};var ue=class{ID;Index;Symbol;Name;ExchangeRate;ConversionSuggestion;ExchangeRateDate;ExchangeRateDateDisplay};var ge=class{ID;Name;DueDays;BlockDays;Description;PrintTemplateID;AccountID};var Ce=class{DeliveryID;InvoiceID;InvoiceNumber;Message;OrderID;PaymentStateID;PaymentStateLabel;PrintMode;Success};var I=class n{estimateState=wi({loadForm:new de,outlet:{Name:"",ID:g.GuidEmpty},order:new Rt,cartItems:[],customer:new ot,tax:new gi,currency:new ue,tag:new ge,discount:{discountAmount:0,discount:0},state:0,complete:new Ce});loadForm=this.estimateState.select(t=>Object.freeze(t.loadForm()));order=this.estimateState.select(t=>Object.freeze(t.order()));outlet=this.estimateState.select(t=>Object.freeze(t.outlet()));cartItems=this.estimateState.select(t=>Object.freeze(t.cartItems()));customer=this.estimateState.select(t=>Object.freeze(t.customer()));tax=this.estimateState.select(t=>Object.freeze(t.tax()));currency=this.estimateState.select(t=>Object.freeze(t.currency()));tag=this.estimateState.select(t=>Object.freeze(t.tag()));discount=this.estimateState.select(t=>Object.freeze(t.discount()));state=this.estimateState.select(t=>Object.freeze(t.state()));complete=this.estimateState.select(t=>Object.freeze(t.complete()));updateLoadForm(t){this.estimateState.update("loadForm",t)}updateOutlet(t){this.estimateState.update("outlet",t)}updateOrder(t){this.estimateState.update("order",t)}updateCartItems(t){this.estimateState.update("cartItems",t)}updateCustomer(t){this.estimateState.update("customer",t)}updateTax(t){this.estimateState.update("tax",t)}updateCurrency(t){this.estimateState.update("currency",t)}updateTag(t){this.estimateState.update("tag",t)}updateDiscount(t){this.estimateState.update("discount",t)}updateState(t){this.estimateState.update("state",t)}updateComplete(t){this.estimateState.update("complete",t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var bt=class{ID;Name;Code;Cost;ThumbnailUrl;CouponDiscount;Discount;DiscountAmount;EntityID;Expense;InventoryTypeID;LoyaltyPoint;Note;PromotionGift;Quantity;UnitQuantity;SalesID;VariantID;VariantUnitQuantity;isMaxInventory;UOM;UOMName;UnitCost;UnitPrice;TypeID;Storage;Taxable;Price;Serial;PriceBookID;Variant;PriceTypeID;PriceNote;UnitPriceMinimum;get Total(){return this.Price*(this.Quantity*this.UnitQuantity)*((100-this.Discount)/100)}get getItemAfterDiscount(){let t=this.getDiscPercentagePerItem();return this.DiscountAmount<t?t-this.DiscountAmount:0}getDiscPercentagePerItem(){let t=this.UnitPrice;return this.Discount>0&&(t=(100-this.Discount)/100*this.UnitPrice),t}};var _t=class n{constructor(){}generateCartItem(t){let e=new bt;return e.Name=t.Name,e.ThumbnailUrl=t.ThumbnailUrl,e.Price=t.UnitPrice,e.UnitPrice=t.UnitPrice,e.UnitCost=t.UnitCost,e.UnitQuantity=t.UnitQuantity,e.Quantity=1,e.Code=t.Code,e.TypeID=t.TypeID,e.Discount=t.PriceDiscount,e.VariantUnitQuantity=t.VariantUnitQuantity,e.Storage=t.Storage,e.UOM=t.UOM,e.UOMName=t.UOMName,e.VariantID=t.ID,e.Taxable=t.Taxable,e.InventoryTypeID=t.TypeID,e.PriceTypeID=t.PriceTypeID,e.PriceNote=t.PriceNote,e.Variant=t,e.UnitPriceMinimum=t.UnitPriceMinimum,e}generateCartItemOnEdit(t){let e=new bt;return e.ID=t.ID,e.Name=t.Variant?.Name,e.ThumbnailUrl=t.Variant?.ThumbnailUrl,e.Price=t.Price,e.UnitPrice=t.Price,e.UnitCost=t.Cost,e.UnitQuantity=t.Variant?.UnitQuantity,e.Quantity=t.Quantity,e.Code=t.Variant?.Code,e.TypeID=t.Variant?.TypeID,e.Discount=t.Discount,e.VariantUnitQuantity=t.Variant?.VariantUnitQuantity,e.Storage=t.Variant?.Storage,e.UOM=t.Variant?.UOM,e.UOMName=t.Variant?.UOMName,e.VariantID=t.VariantID,e.Taxable=t.Taxable,e.Note=t.Note,e.Serial=t.Serial,e.InventoryTypeID=t.InventoryTypeID,e.PriceTypeID=t.PriceTypeID,e.Variant=t.Variant,e.PriceNote=t.PriceNote,e}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Qt=class n{httpService=p(J);storeService=p(I);factoryService=p(_t);activatedRoute=p(Ke);getLoadForm$=this.activatedRoute.queryParams.pipe(K(t=>this.httpService.post("/API/estimate/LoadForm",t)),O(t=>this.storeService.updateLoadForm(t)),O(t=>{g.IsNotEmpty(t.Data)?this.onEditOrder(t):(this.initDefaultCurrency(),this.initTag(),this.initTax())}),k());constructor(){this.getLoadForm$.subscribe()}onEditOrder(t){let e=t.Data,i=this.findTaxById(e.Order.TaxTypeID),o=this.findCurrencyById(e.Order.CurrencyID),l=this.findOutletById(e.Order.EntityID),h=this.findTagById(e.Order.TypeID),D=this.getCartItemsOnEdit(t);this.storeService.updateState(1),this.storeService.updateOrder(e.Order),this.storeService.updateCartItems(D),this.storeService.updateCustomer({Key:e.Order.CustomerID,Value:e.ContactName}),this.storeService.updateTax(i),this.storeService.updateCurrency(o),this.storeService.updateOutlet(l),this.storeService.updateDiscount({discount:e.Order.Discount,discountAmount:e.Order.DiscountAmount}),this.storeService.updateTag(h)}getCartItemsOnEdit(t){return t.Data.Items.map(o=>this.factoryService.generateCartItemOnEdit(o))}initDefaultCurrency(){let t=this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID,e=this.storeService.loadForm()?.Currencies.find(i=>i.ID===t);this.storeService.updateCurrency(e)}initTag(){let t=this.storeService.loadForm()?.SalesOrderTags;this.storeService.updateTag(t[0])}initTax(){let t=this.storeService.loadForm()?.Taxes;this.storeService.updateTax(t[0])}findTaxById(t){return(this.storeService.loadForm()?.Taxes).find(o=>o.ID===t)}findCurrencyById(t){return(this.storeService.loadForm()?.Currencies).find(o=>o.ID===t)}findOutletById(t){return(this.storeService.loadForm()?.Entities).find(o=>o.ID===t)}findTagById(t){return(this.storeService.loadForm()?.SalesOrderTags).find(o=>o.ID===t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Lt=class n{storeService=p(I);isOpenDialog$=B(this.storeService.loadForm).pipe(P(t=>g.IsNotEmpty(t.Entities)),st(()=>{let t=!1,e=this.storeService.state(),i=this.storeService.outlet();return(e==0||e==1)&&(t=g.IsEmpty(i.ID)),t}));updateOutlet(t){this.storeService.updateOutlet(t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac,providedIn:"root"})};var lt=class n{storeService=p(I);httpService=p(J);router=p(Et);orderNumber$=B(this.storeService.outlet).pipe(P(t=>g.IsNotEmpty(t.ID)),K(t=>{if(this.storeService.state()==0)return this.httpService.post(L.EstimateGenerateNumber,{ID:t.ID}).pipe(st(e=>e.Number));{let e=this.storeService.order().Number;return Ee(e)}}),O(t=>{this.storeService.state()==0&&this.updateOrderNumber(t)}),k());salesPersons$=B(this.storeService.outlet).pipe(K(t=>g.IsNotEmpty(t.ID)?this.httpService.get(L.GetSalesPersonByOutletId,[{key:"ID",value:t.ID}]):Ee([])),It(1));updateTagOrder$=B(this.storeService.tag).pipe(O(t=>{let e=N({},this.storeService.order());e.TypeID=t.ID,this.storeService.updateOrder(e)}),k());updateCurrencyOrder$=B(this.storeService.currency).pipe(O(t=>{let e=N({},this.storeService.order());e.CurrencyID=t.ID,this.storeService.updateOrder(e)}),k());updateTaxOrder$=B(this.storeService.tax).pipe(O(t=>{let e=N({},this.storeService.order());e.TaxTypeID=t.ID,this.storeService.updateOrder(e)}),k());updateDiscountOrder$=B(this.storeService.discount).pipe(O(t=>{let e=N({},this.storeService.order());e.Discount=t.discount,e.DiscountAmount=t.discountAmount,this.storeService.updateOrder(e)}),k());updateCustomerOrder$=B(this.storeService.customer).pipe(O(t=>{let e=N({},this.storeService.order());e.CustomerID=t.Key,this.storeService.updateOrder(e)}),k());updateEntityId$=B(this.storeService.outlet).pipe(P(t=>g.IsNotEmpty(t.ID)),O(t=>{let e=N({},this.storeService.order());e.EntityID=t.ID,this.storeService.updateOrder(e)}),k());constructor(){this.updateTagOrder$.subscribe(),this.updateCurrencyOrder$.subscribe(),this.updateTaxOrder$.subscribe(),this.updateDiscountOrder$.subscribe(),this.updateCustomerOrder$.subscribe(),this.updateEntityId$.subscribe()}newOrder(){let t=this.storeService.loadForm(),e=this.getDefaultCurrency(),i=this.storeService.outlet();this.storeService.updateOrder(new Rt),this.storeService.updateCartItems([]),this.storeService.updateCustomer(new ot),this.storeService.updateTax(N({},t.Taxes[0])),this.storeService.updateCurrency(N({},e)),this.storeService.updateTag(N({},t.SalesOrderTags[0])),this.storeService.updateDiscount({discountAmount:0,discount:0}),this.storeService.updateOutlet(N({},i)),this.router.navigate([],{queryParams:{}}),this.storeService.updateState(0)}getDefaultCurrency(){let t=this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID;return this.storeService.loadForm()?.Currencies.find(i=>i.ID===t)}updateOrderNumber(t){g.IsNotEmpty(t)&&this.storeService.order().Number!==t&&this.storeService.updateOrder(jt(N({},this.storeService.order()),{Number:t}))}updateOrderDate(t){g.IsNotEmpty(t)&&this.storeService.order().Date!==t&&this.storeService.updateOrder(jt(N({},this.storeService.order()),{Date:t}))}updateSalesPersonId(t){let e=N({},this.storeService.order());e.SalesID=t,this.storeService.updateOrder(e)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Wt=class n{storeService=p(I);httpService=p(J);quickkeys$=B(this.storeService.outlet).pipe(P(t=>g.IsNotEmpty(t.ID)),Re((t,e)=>t.ID===e.ID),K(t=>this.httpService.get(L.GetQuickKeyByEntityID,[{key:"ID",value:t.ID}])),It(1));static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Ni=n=>({"qtyBtn-disabled":n}),fe=class n{disabled=!1;decimalPlaces=4;max=1e15;min=-1e15;quantity;constructor(){}ngOnInit(){}incrementQty(){this.quantity<this.max&&(this.quantity++,this.onChange(this.quantity))}decrementQty(){this.quantity>this.min&&(this.quantity--,this.onChange(this.quantity))}quantityChange(){this.onChange(this.quantity)}onChange=t=>{};onTouched=()=>{};writeValue(t){g.IsEmpty(t)?this.quantity=0:this.quantity=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-input-quantity"]],inputs:{disabled:"disabled",decimalPlaces:"decimalPlaces",max:"max",min:"min"},features:[Mt([{provide:ee,multi:!0,useExisting:n}])],decls:6,vars:11,consts:[[1,"input-group"],["type","button","id","button-addon1",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-2","border-end-0","py-4","qty-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"],["id","txtCartQuantity","type","text","autoNum","",1,"form-control","input-numpad","qty-input","text-center",3,"ngModelChange","ngModel","disabled","decimalPlaces"],["type","button","id","button-addon2",1,"btn","btn-outline-secondary","fw-bold","rounded-0","fs-5","border-start-0","py-4","qty-input","d-flex","align-items-center","qty_btn","justify-content-center",3,"click","ngClass","disabled"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"button",1),d("click",function(){return i.decrementQty()}),s(2,"-"),a(),r(3,"input",2),Q("ngModelChange",function(l){return j(i.quantity,l)||(i.quantity=l),l}),d("ngModelChange",function(){return i.quantityChange()}),a(),r(4,"button",3),d("click",function(){return i.incrementQty()}),s(5,"+"),a()()),e&2&&(c(),u("ngClass",$(7,Ni,i.disabled))("disabled",i.disabled),c(2),U("ngModel",i.quantity),u("disabled",i.disabled)("decimalPlaces",i.decimalPlaces),c(),u("ngClass",$(9,Ni,i.disabled))("disabled",i.disabled))},dependencies:[A,Z,it,tt,G,et,ft],styles:[".qtyBtn-disabled[_ngcontent-%COMP%]{background-color:#e9ecef;color:#000!important}button.qty_btn[_ngcontent-%COMP%]{background:#eee;border:1px solid #ddd;width:36px}.qty-input[_ngcontent-%COMP%]{height:36px!important}"]})};var ht=class n{storeService=p(I);autoApplyPricebook(t){let e=t?.Variant?.PriceBook?t?.Variant?.PriceBook:[],i=this.storeService.customer(),o=this.findCustomerPricebook(e,i),l=this.sortAppliedPricebooks(e,t.Quantity);return l.length>0||g.IsNotEmpty(o)?g.IsNotEmpty(o)?t=this.applyPricebook(t,o):t=this.applyPricebook(t,l[0]):t.PriceTypeID===2&&(t=this.removePricebook(t)),t}findCustomerPricebook(t=[],e){let i;return g.IsNotEmpty(e)&&g.IsNotEmpty(e?.Key)&&(i=t.find(o=>o.ID==e.PricebookID)),i}applyCustomerPricebook(){let t=[],e=this.storeService.customer(),i=this.storeService.cartItems();return g.IsNotEmpty(e.PricebookID)&&i.forEach(o=>{let l=this.findCustomerPricebook(o.Variant.PriceBook,e);l&&(o=this.applyPricebook(o,l),t.push(o))}),t}removeCustomerPricebook(t){let e=[];return this.storeService.cartItems().forEach(o=>{this.findCustomerPricebook(o.Variant.PriceBook,t)&&(o=this.removePricebook(o),e.push(o))}),e}sortAppliedPricebooks(t=[],e){return t.sort((i,o)=>o.MinimumQuantity-i.MinimumQuantity).filter(i=>e>=i.MinimumQuantity&&i.MinimumQuantity!=0)}applyPricebook(t,e){let i=this.storeService.loadForm()?.AppConfigJSON?.ModuleSell?.Pricebook?.PricebookVisible;return t.Discount=e.PriceDiscount,t.UnitPrice=e.UnitPrice,t.PriceBookID=e.ID,t.Price=e.UnitPrice,t.PriceTypeID=2,t.PriceNote=e.Name,i?t.Note=e.Name:t.Note="",t}removePricebook(t){return t.Discount=t.Variant.PriceDiscount,t.UnitPrice=t.Variant.UnitPrice,t.PriceBookID=null,t.Price=t.Variant.UnitPrice,t.PriceTypeID=0,t.Note="",t.PriceNote="",t}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var we=n=>({selected:n}),Bi=()=>["/menu/Products/Catalog/Variants/Info"],Ui=n=>({ID:n});function ji(n,t){if(n&1){let e=F();r(0,"a",13),d("click",function(){b(e);let o=m();return _(o.tabState="PRODUCT")}),s(1," Product "),a()}if(n&2){let e=m();u("ngClass",$(1,we,e.tabState=="PRODUCT"))}}function Qi(n,t){if(n&1){let e=F();r(0,"a",14),d("click",function(){b(e);let o=m();return _(o.tabState="SERIAL")}),s(1," Serial "),a()}if(n&2){let e=m();u("ngClass",$(1,we,e.tabState=="SERIAL"))}}function Li(n,t){if(n&1&&(r(0,"div",10),S(1,"div",15),a()),n&2){let e=m();c(),u("innerHTML",e.cartItemService.priceMinimumRestrictionWarning(),zt)}}function Wi(n,t){if(n&1&&(r(0,"div",16)(1,"div",25),S(2,"POS-variant-autocomplete",26),a()()),n&2){let e=m(2);c(2),u("formControl",e.variantSearchCtrl)}}function $i(n,t){if(n&1&&(r(0,"span"),s(1),a()),n&2){let e=m(2);c(),x("(",e.cartItem().UOMName,")")}}function qi(n,t){if(n&1){let e=F();r(0,"div",19)(1,"h6"),s(2,"Pricebook"),a(),r(3,"ng-select",27),Q("ngModelChange",function(o){b(e);let l=m(2);return j(l.cartItem().PriceBookID,o)||(l.cartItem().PriceBookID=o),_(o)}),d("ngModelChange",function(o){b(e);let l=m(2);return _(l.onSelectPricebook(o))}),a()()}if(n&2){let e,i=m(2);c(3),u("items",(e=i.cartItem())==null||e.Variant==null?null:e.Variant.PriceBook),U("ngModel",i.cartItem().PriceBookID)}}function Hi(n,t){if(n&1){let e=F();C(0,Wi,3,1,"div",16),r(1,"div",16)(2,"div",17)(3,"h6"),s(4," Qty "),C(5,$i,2,1,"span"),a(),r(6,"POS-input-quantity",18,0),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Quantity,o)||(l.cartItem().Quantity=o),_(o)}),d("ngModelChange",function(){b(e);let o=m();return _(o.onQtyChange())}),a()(),r(8,"div",19)(9,"h6"),s(10,"Discount (%)"),a(),r(11,"input",20),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Discount,o)||(l.cartItem().Discount=o),_(o)}),a()(),r(12,"div",19)(13,"h6"),s(14,"Price"),a(),r(15,"input",21,1),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Price,o)||(l.cartItem().Price=o),_(o)}),a()(),C(17,qi,4,2,"div",19),a(),r(18,"div",22)(19,"div",23)(20,"POS-tinymce-editor",24),Q("ngModelChange",function(o){b(e);let l=m();return j(l.cartItem().Note,o)||(l.cartItem().Note=o),_(o)}),a()()()}if(n&2){let e,i=m();f(i.isEditState()==!1?0:-1),c(5),f(i.cartItem().UOMName?5:-1),c(),U("ngModel",i.cartItem().Quantity),u("decimalPlaces",i.isSerialItem()?0:4),c(5),U("ngModel",i.cartItem().Discount),c(4),U("ngModel",i.cartItem().Price),u("disabled",!(!(i.roleService==null||i.roleService.sell==null)&&i.roleService.sell.UnitPriceEditor)),c(2),f(((e=i.cartItem().Variant)==null||e.PriceBook==null?null:e.PriceBook.length)>0?17:-1),c(3),U("ngModel",i.cartItem().Note)}}function zi(n,t){n&1&&(S(0,"i",44),r(1,"h6"),s(2,"No Image"),a())}function Gi(n,t){if(n&1&&S(0,"img",30),n&2){let e=m(2);u("src",e.cartItem().ThumbnailUrl,Gt)}}function Ji(n,t){if(n&1&&(r(0,"tr")(1,"td",45),s(2),v(3,"number"),a(),r(4,"td",45),s(5),v(6,"number"),a(),r(7,"td",45),s(8),v(9,"number"),a()()),n&2){let e=t;c(2),x(" ",y(3,3,e==null?null:e.OnHand)," "),c(3),x(" ",y(6,5,e==null?null:e.Allocated)," "),c(3),x(" ",y(9,7,(e==null?null:e.OnHand)-(e==null?null:e.Allocated))," ")}}function Ki(n,t){if(n&1){let e=F();r(0,"tr")(1,"th",42),s(2,"Cost"),a(),r(3,"td",46)(4,"input",47),Q("ngModelChange",function(o){b(e);let l=m(2);return j(l.cartItem().UnitCost,o)||(l.cartItem().UnitCost=o),_(o)}),a()()()}if(n&2){let e,i=m(2);c(4),U("ngModel",i.cartItem().UnitCost),u("readonly",!(!((e=i.appConfig())==null||e.ModuleSell==null)&&e.ModuleSell.Cost.Enabled))}}function Yi(n,t){if(n&1&&(r(0,"tr")(1,"th",42),s(2,"Content"),a(),r(3,"td",43)(4,"div",48),s(5),v(6,"number"),a()()()),n&2){let e,i=m(2);c(5),xt(" ",(e=i.cartItem())==null?null:e.VariantUnitQuantity," (@",y(6,2,i.cartItem().Price/((e=i.cartItem())==null?null:e.VariantUnitQuantity)),")")}}function Xi(n,t){if(n&1&&(r(0,"div",40)(1,"table",49)(2,"thead")(3,"tr")(4,"th",50),s(5,"Storage Location"),a()()(),r(6,"tbody")(7,"tr")(8,"td"),s(9),a()()()()()),n&2){let e=m(2);c(9),x(" ",e.cartItem().Storage," ")}}function Zi(n,t){if(n&1&&(r(0,"div",11)(1,"div",28)(2,"a",29),C(3,zi,3,0)(4,Gi,1,1,"img",30),a()(),r(5,"div",31)(6,"div",32)(7,"div",23)(8,"div",33),S(9,"i",34),r(10,"div",35),s(11,"Inventory"),a()(),r(12,"table",36)(13,"thead")(14,"tr")(15,"th",37),s(16,"On Hand"),a(),r(17,"th",37),s(18,"Allocated"),a(),r(19,"th",38),s(20,"Available"),a()()(),r(21,"tbody"),C(22,Ji,10,9,"tr"),v(23,"async"),a()()()(),r(24,"div",39)(25,"div",40)(26,"table",41)(27,"thead"),C(28,Ki,5,2,"tr"),r(29,"tr")(30,"th",42),s(31,"Price"),a(),r(32,"td",43),s(33),v(34,"number"),a()(),C(35,Yi,7,4,"tr"),a()()(),C(36,Xi,10,1,"div",40),a()()()),n&2){let e,i,o,l,h,D,W,rt=m();c(2),u("routerLink",Yt(12,Bi))("queryParams",$(13,Ui,(e=rt.cartItem())==null?null:e.ID)),c(),f(((i=rt.cartItem())==null?null:i.ThumbnailUrl)==null?3:4),c(19),f((o=y(23,8,rt.variantInventory$))?22:-1,o),c(6),f(!((l=rt.appConfig())==null||l.ModuleSell==null)&&l.ModuleSell.Cost.Visible&&rt.roleService.product.Cost?28:-1),c(5),x(" ",y(34,10,(h=rt.cartItem())==null?null:h.Price)," "),c(2),f(((D=rt.cartItem())==null?null:D.VariantUnitQuantity)>1?35:-1),c(),f(!((W=rt.appConfig())==null||W.ModuleSell==null||W.ModuleSell.Grid==null)&&W.ModuleSell.Grid.StorageVisible&&((W=rt.cartItem())!=null&&W.Storage)?36:-1)}}function tn(n,t){if(n&1){let e=F();r(0,"app-item-serial",51),d("cartItemChange",function(o){b(e);let l=m();return _(l.onSerialChanges(o))}),a()}if(n&2){let e=m();u("entityId",e.storeService.outlet().ID)("cartItem",e.cartItem())}}var qt=class n{constructor(t,e){this.data=t;this.dialogRef=e;this.cartItem=w(t),this.initVariantInventory(),this.initIsSerialItem(),this.initModalConfig(),this.initDialogState()}storeService=p(I);cartItemService=p(ct);roleService=p(Ct);toastr=p(te);pricebookService=p(ht);modalConfig=new kt;tabState="CART";cartItem;appConfig=w(this.storeService.loadForm()?.AppConfigJSON);isSerialItem=w(!1);variantInventory$;isEditState=w(!1);showProductTab=w(!1);variantSearchCtrl=new Ot;getItemFromSearch$=this.variantSearchCtrl.valueChanges.pipe(P(t=>g.IsNotEmpty(t)),K(t=>{if(t.type==="ID")return this.cartItemService.getItemByVariantId(t.str);if(t.type==="Code")return this.cartItemService.getItemByVariantByCode(t.str)}),O(t=>{this.cartItem.set(t),this.initModalTitle(),this.initProductTab(),this.initIsSerialItem(),this.initVariantInventory()}),k());ngOnInit(){this.isEditState()||this.getItemFromSearch$.subscribe()}initDialogState(){this.isEditState.set(g.IsNotEmpty(this.cartItem().VariantID)),this.initProductTab()}initVariantInventory(){this.variantInventory$=this.cartItemService.getVariantInventory(this.cartItem().VariantID).pipe(It(1))}initProductTab(){this.showProductTab.set(g.IsNotEmpty(this.cartItem().VariantID))}initIsSerialItem(){this.isSerialItem.set(this.cartItem().TypeID==9)}initModalConfig(){this.initModalTitle(),this.modalConfig.customWidth="680px",this.modalConfig.noPadding=!0,this.modalConfig.bodyScrollable=!0}initModalTitle(){this.modalConfig.title=this.cartItem()?.Name??"Add Variant"}onSerialChanges(t){this.cartItem.set(t)}onQtyChange(){let t=this.pricebookService.autoApplyPricebook(this.cartItem());this.cartItem.set(t)}onSelectPricebook(t){let e;if(g.IsNotEmpty(t)){let o=this.cartItem().Variant.PriceBook.find(l=>l.ID===t);e=this.pricebookService.applyPricebook(this.cartItem(),o)}else e=this.pricebookService.removePricebook(this.cartItem());this.cartItem.set(e)}onCancel(){this.dialogRef.close()}onSave(){if(g.IsNotEmpty(this.cartItem().VariantID)&&g.IsNotEmpty(this.cartItem().Name)){if(!this.cartItemService.validatePriceMinimum(this.cartItem(),this.appConfig))return;this.dialogRef.close(this.cartItem())}else this.toastr.warning("Please select a product","Warning")}ngOnDestroy(){this.cartItemService.priceMinimumRestrictionWarning.set("")}static \u0275fac=function(e){return new(e||n)(Y(Vt),Y(At))};static \u0275cmp=M({type:n,selectors:[["app-dialog-item"]],decls:14,vars:10,consts:[["quantity",""],["price",""],[3,"onOk","onCancel","onClose","config"],[1,"mb-5"],[1,"container","w-100","h-100","mt-8"],[1,"row","border-bottom","mx-5"],["data-cy","input_sell",1,"btn","btn-link",3,"click","ngClass"],["data-cy","product",1,"btn","btn-link",3,"ngClass"],["data-cy","serial",1,"btn","btn-link",3,"ngClass"],[1,"mx-8"],[1,"bg-gradient-warning","p-4","justify-content-center","align-items-center","d-flex","gap-2",2,"margin-top","12px","border-radius","8px"],[1,"row","my-8"],[3,"entityId","cartItem"],["data-cy","product",1,"btn","btn-link",3,"click","ngClass"],["data-cy","serial",1,"btn","btn-link",3,"click","ngClass"],[3,"innerHTML"],[1,"row","mt-8"],[1,"col-auto","pe-0",2,"width","145px"],[3,"ngModelChange","ngModel","decimalPlaces"],[1,"col-auto","pe-0"],["type","text","percentage","","autoNum","",1,"form-control","input-cart",2,"width","100px",3,"ngModelChange","ngModel"],["id","inputPrice","type","text","autoNum","",1,"form-control","input-cart",2,"width","112px",3,"ngModelChange","ngModel","disabled"],[1,"row","my-6"],[1,"col-12"],["height","220px",3,"ngModelChange","ngModel"],[1,"col-12","px-0"],[3,"formControl"],["bindLabel","Name","bindValue","ID","placeholder","Pricebook","appendTo","body",2,"width","170px",3,"ngModelChange","items","ngModel"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[1,"border","rounded",3,"src"],[1,"col-sm-8","inventory"],[1,"row","mb-8"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family","'Roboto Slab'"],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","py-6","border-end",2,"text-transform","none"],[1,"table-light","py-6",2,"text-transform","none"],[1,"row"],[1,"col-6"],[1,"table","table-bordered",2,"width","171px"],[1,"table-light",2,"text-transform","none"],[1,"pe-6","text-end"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"py-6"],[1,"p-0"],["type","text","autoNum","",1,"form-control","border-0","bg-white","text-end",3,"ngModelChange","ngModel","readonly"],["ngClass","ms-3"],[1,"table","table-bordered","text-center"],[1,"table-light"],[3,"cartItemChange","entityId","cartItem"]],template:function(e,i){e&1&&(r(0,"modal-material",2),d("onOk",function(){return i.onSave()})("onCancel",function(){return i.onCancel()})("onClose",function(){return i.onCancel()}),r(1,"content",3)(2,"div",4)(3,"div",5)(4,"div")(5,"a",6),d("click",function(){return i.tabState="CART"}),s(6," Cart "),a(),C(7,ji,2,3,"a",7),C(8,Qi,2,3,"a",8),a()(),r(9,"div",9),C(10,Li,2,1,"div",10),C(11,Hi,21,9),C(12,Zi,37,15,"div",11),C(13,tn,1,2,"app-item-serial",12),a()()()()),e&2&&(u("config",i.modalConfig),c(5),u("ngClass",$(8,we,i.tabState=="CART")),c(2),f(i.showProductTab()?7:-1),c(),f(i.isSerialItem()?8:-1),c(2),f(i.cartItemService.priceMinimumRestrictionWarning()&&i.cartItemService.priceMinimumRestrictionWarning().trim()!==""?10:-1),c(),f(i.tabState=="CART"?11:-1),c(),f(i.tabState=="PRODUCT"?12:-1),c(),f(i.tabState=="SERIAL"?13:-1))},dependencies:[A,Z,Nt,it,tt,G,et,ft,re,Zt,Xt,pe,wt,Tt,Si,xi,fe,Ft,Pt,z],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.input-cart[_ngcontent-%COMP%]{height:36px!important}"]})};var ct=class n{httpService=p(J);storeService=p(I);factoryService=p(_t);pricebookService=p(ht);userRoleService=p(ui);decimalPipe=p(z);dialog=p(nt);variantSearchCtrl=new Ot;viewContainerRef=p(Qe);selectedCustomer;cartItemEvent=new ke;onEditCartItems$=B(this.storeService.cartItems).pipe(P(()=>this.storeService.state()==1),st(t=>({action:"INIT",items:t})),Be());priceMinimumRestrictionWarning=w("");applyCustomerPricebook$=B(this.storeService.customer).pipe(O(t=>{this.onApplyCustomerPricebook(t)}),k());cartItems$=Ae(this.onEditCartItems$,this.cartItemEvent.asObservable()).pipe(Ue((t,e)=>{let i=[];switch(e.action){case"INIT":i=e.items;break;case"ADD":i=this.addNewItem(t,e);break;case"UPDATE":i=this.updateItems(t,e);break;case"REMOVE":i=t.filter((o,l)=>e.index!==l);break;case"CLEAR":i=[];break;case"PURCHASE":i=this.updateItems(t,e);break;case"RETURN":i=this.updateItems(t,e);break;case"DROP":i=e.items;break}return this.storeService.updateCartItems(i),i},this.storeService.cartItems()));addCartItemBySearch$=this.variantSearchCtrl.valueChanges.pipe(P(t=>g.IsNotEmpty(t)),O(t=>{t.type==="ID"?this.addItemByVariantId(t.str):t.type==="Code"&&this.addItemByVariantCode(t.str)}),k());constructor(){this.addCartItemBySearch$.subscribe(),this.applyCustomerPricebook$.subscribe()}onApplyCustomerPricebook(t){let e=[],i=this.storeService.cartItems();g.IsNotEmpty(t.PricebookID)?(this.selectedCustomer=t,e=this.pricebookService.applyCustomerPricebook()):g.IsNotEmpty(this.selectedCustomer)&&(e=this.pricebookService.removeCustomerPricebook(this.selectedCustomer),this.selectedCustomer=null),i.forEach((o,l)=>{let h=e.find(D=>D.VariantID===o.VariantID);h&&this.updateCartItem({cartItem:h,index:l})})}onApplyPricebook(t){return this.pricebookService.autoApplyPricebook(t)}onOpenAddDialog(){this.dialog.open(qt,{data:new bt,viewContainerRef:this.viewContainerRef}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{this.cartItemEvent.next({item:t,action:"ADD",newRow:!0})})}onOpenEditDialog(t){this.dialog.open(qt,{data:N({},t.cartItem),viewContainerRef:this.viewContainerRef}).afterClosed().pipe(P(e=>g.IsNotEmpty(e))).subscribe(e=>{this.cartItemEvent.next({item:e,action:"UPDATE",index:t.index})})}onSelectQuickkeyItem(t){this.addItemByVariantId(t)}addNewItem(t,e){let i=[],o=t.find(l=>l.VariantID===e.item?.VariantID);return o?e.newRow?(e.item=this.onApplyPricebook(e.item),i=[...t,e.item]):(o.Quantity+=1,o=this.onApplyPricebook(o),i=[...t]):(e.item=this.onApplyPricebook(e.item),i=[...t,e.item]),i}updateItems(t,e){return t.map((o,l)=>l===e.index?pi(bt,e.item):o)}onDropItems(t){this.cartItemEvent.next({action:"DROP",items:t})}addItemByVariantId(t){this.getItemByVariantId(t).pipe(O(e=>{this.cartItemEvent.next({item:e,action:"ADD",newRow:!1})})).subscribe()}addItemByVariantCode(t){this.getItemByVariantByCode(t).pipe(O(e=>{this.cartItemEvent.next({item:e,action:"ADD",newRow:!1})})).subscribe()}removeCartItem(t){this.cartItemEvent.next({action:"REMOVE",index:t.index})}updateCartItem(t){this.cartItemEvent.next({action:"UPDATE",item:t.cartItem,index:t.index})}clearCart(){this.dialog.open(ki,{data:{title:"Clear Order Items",message:'<p class="h4">Are you sure you want to clear all order items?</p>',headerType:St.Warning}}).afterClosed().pipe(P(t=>t)).subscribe(()=>{this.cartItemEvent.next({action:"CLEAR"})})}onPurchaseItem(t){this.cartItemEvent.next({action:"PURCHASE",item:t.cartItem,index:t.index})}onReturnItem(t){this.cartItemEvent.next({action:"RETURN",item:t.cartItem,index:t.index})}getItemByVariantId(t){return this.httpService.get(L.GetVariantByID,[{key:"ID",value:t},{key:"EntityID",value:this.storeService.outlet().ID}]).pipe(st(e=>this.factoryService.generateCartItem(e)))}getItemByVariantByCode(t){return this.httpService.get(L.GetVariantByCode,[{key:"Code",value:t},{key:"EntityID",value:this.storeService.outlet().ID},{key:"Promotion",value:!0}]).pipe(st(e=>this.factoryService.generateCartItem(e)))}getVariantInventory(t){return this.httpService.get(L.GetVariantStockByID,[{key:"EntityID",value:this.storeService.outlet().ID},{key:"ID",value:t}])}validatePriceMinimum(t,e){let i=!0,o=this.userRoleService.Data.PriceMinimum,l=e().ModuleSell.ProductDialog.PriceMinimumTypeID;if(o){let h=0;switch(l){case 1:h=t.UnitPrice;break;case 2:h=t.UnitCost;break;case 3:h=t.UnitPriceMinimum;break}if(t.Price<h){i=!1;let D=g.StringFormat("<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Cannot sell lower than <h5 class='d-inline m-0'>{0}</h5></span>",this.decimalPipe.transform(h));this.priceMinimumRestrictionWarning.set(D)}else i=!0,this.priceMinimumRestrictionWarning.set("")}return i}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};function en(n,t){if(n&1&&(r(0,"td",8),s(1),a()),n&2){let e=m().$index;c(),x(" ",e+1,". ")}}function nn(n,t){if(n&1&&(r(0,"div",11),S(1,"img",31),a()),n&2){let e=m().$implicit;c(),u("src",e.ThumbnailUrl,Gt)}}function on(n,t){n&1&&(r(0,"div",12),S(1,"i",32),a())}function rn(n,t){if(n&1&&S(0,"small",16),n&2){let e=m().$implicit;u("innerHtml",e.Note,zt)}}function an(n,t){if(n&1&&(r(0,"span",20),s(1),v(2,"number"),a()),n&2){let e=m().$implicit;c(),R(Te(2,1,e.Quantity,"1.0-4"))}}function ln(n,t){if(n&1&&(r(0,"span",33),s(1,"x"),a(),r(2,"div",34)(3,"span",35),s(4),v(5,"number"),a()()),n&2){let e=m().$implicit;c(4),R(y(5,1,e.UnitQuantity))}}function cn(n,t){if(n&1&&(r(0,"span",21),s(1),v(2,"number"),a()),n&2){let e=m().$implicit;c(),x("@",y(2,1,e.VariantUnitQuantity))}}function sn(n,t){if(n&1&&(r(0,"small",22),s(1),a()),n&2){let e=m().$implicit;c(),R(e.UOM?e==null?null:e.UOMName:"")}}function mn(n,t){if(n&1&&(r(0,"div",24),s(1),v(2,"number"),a()),n&2){let e=m().$implicit;c(),x(" ",Te(2,1,e.Price,"1.0-4")," ")}}function pn(n,t){if(n&1){let e=F();r(0,"tr",7),d("contextmenu",function(o){let l=b(e),h=l.$implicit,D=l.$index,W=m(2);return _(W.onContextMenu(o,h,D))}),C(1,en,2,1,"td",8),r(2,"td",9),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(3,"div",10),C(4,nn,2,1,"div",11)(5,on,2,0,"div",12),r(6,"div",13)(7,"div"),s(8),a(),r(9,"span",14),s(10),a(),r(11,"div"),S(12,"app-serial-note",15),a(),C(13,rn,1,1,"small",16),a()()(),r(14,"td",17),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(15,"div",18)(16,"div",19),C(17,an,3,4,"span",20),C(18,ln,6,3),C(19,cn,3,3,"span",21),C(20,sn,2,1,"small",22),a()()(),r(21,"td",23),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),C(22,mn,3,4,"div",24),a(),r(23,"td",23),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(24,"div",25),s(25),v(26,"number"),a()(),r(27,"td",26),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onEdit(l,h))}),r(28,"div",18)(29,"div",20),s(30),v(31,"number"),a()()(),r(32,"td",27)(33,"div",28)(34,"span",29),d("click",function(){let o=b(e),l=o.$implicit,h=o.$index,D=m(2);return _(D.onRemove(l,h))}),S(35,"i",30),a()()()()}if(n&2){let e=t.$implicit,i=m(2);c(),f(i.appConfig!=null&&i.appConfig.ModuleSell.Grid.RowNumberVisible?1:-1),c(3),f(e.ThumbnailUrl?4:5),c(4),R(e.Name),c(2),R(e.Code),c(2),u("serials",e==null?null:e.Serial),c(),f(e.Note?13:-1),c(4),f(e.Quantity!==1&&e.Quantity!==0||e.UnitQuantity>1||e.VariantUnitQuantity>1?17:-1),c(),f(e.UnitQuantity>1?18:-1),c(),f(e.VariantUnitQuantity>1?19:-1),c(),f(e.UOM&&(!(i.appConfig==null||i.appConfig.ModuleSell==null)&&i.appConfig.ModuleSell.Grid.UOMVisible)?20:-1),c(2),f(e.Price!==e.Total?22:-1),c(3),x(" ",e.Discount?y(26,13,e.Discount*-1)+"%":""," "),c(5),x(" ",i.roleService.product!=null&&i.roleService.product.Price?y(31,15,e.Total):" - "," ")}}function dn(n,t){if(n&1){let e=F();r(0,"table",1)(1,"tbody",5),d("cdkDropListDropped",function(o){b(e);let l=m();return _(l.onDrop(o))}),pt(2,pn,36,17,"tr",6,mt),a()()}if(n&2){let e=m();c(2),dt(e.cartItems)}}function un(n,t){n&1&&(r(0,"div",2)(1,"div",36)(2,"div",37)(3,"div",38)(4,"div",39),S(5,"i",40),a(),r(6,"div",41)(7,"span"),s(8,"Empty Cart"),a(),S(9,"br"),r(10,"span"),s(11,"Add products to the cart"),a(),S(12,"br"),r(13,"span"),s(14,"or scan barcode"),a()()()()()())}function gn(n,t){if(n&1){let e=F();r(0,"button",42),d("click",function(){let o=b(e).item,l=m();return _(l.onReverse(o,!0))}),s(1,"Return"),a(),r(2,"button",42),d("click",function(){let o=b(e).item,l=m();return _(l.onReverse(o,!1))}),s(3,"Purchase"),a()}}var be=class n{roleService=p(Ct);appConfig;cartItems=[];set _cartItems(t){t&&(this.cartItems=[...t])}onRemoveEvent=new V;onEditEvent=new V;onDropItems=new V;onReturnEvent=new V;onPurchaseEvent=new V;contextMenu;contextMenuPosition={x:"0px",y:"0px"};onContextMenu(t,e,i){t.preventDefault(),this.contextMenuPosition.x=t.clientX+"px",this.contextMenuPosition.y=t.clientY+"px",e.Index=i,this.contextMenu.menuData={item:e},this.contextMenu.openMenu()}onDrop(t){ti(this.cartItems,t.previousIndex,t.currentIndex),this.onDropItems.emit(this.cartItems)}onEdit(t,e){this.onEditEvent.emit({cartItem:t,index:e})}onRemove(t,e){this.onRemoveEvent.emit({cartItem:t,index:e})}onReverse(t,e){let i=t.Index;e?(t.Quantity>0&&(t.Quantity=t.Quantity*-1),this.onReturnEvent.emit({cartItem:t,index:i})):(t.Quantity<0&&(t.Quantity=t.Quantity*-1),this.onPurchaseEvent.emit({cartItem:t,index:i}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-cart-display"]],viewQuery:function(e,i){if(e&1&&qe(ae,7),e&2){let o;He(o=ze())&&(i.contextMenu=o.first)}},inputs:{appConfig:"appConfig",_cartItems:[0,"cartItems","_cartItems"]},outputs:{onRemoveEvent:"onRemove",onEditEvent:"onEdit",onDropItems:"onDropItems",onReturnEvent:"onReturn",onPurchaseEvent:"onPurchase"},decls:6,vars:6,consts:[["contextMenu","matMenu"],[1,"table","table-borderless"],[1,"row","g-0","h-100"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["matMenuContent",""],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",1,"border-bottom"],["cdkDrag","",1,"border-bottom",3,"contextmenu"],[2,"width","10px"],[1,"pe-0",2,"width","50%",3,"click"],[1,"d-flex","align-items-center"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"d-block","ms-4",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%",3,"click"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[1,"fs-5"],["title","Variant Unit Quantity",1,"fs-5"],["title","UOM",1,"ps-1","fs-5"],[3,"click"],[1,"fs-5","text-end"],[1,"fw-normal","fs-5","text-danger"],[1,"pe-0",3,"click"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6","me-1","ms-1"],[1,"d-flex","algin-items-center"],["title","Unit Quantity",1,"fs-5","me-1"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"],["mat-menu-item","",3,"click"]],template:function(e,i){if(e&1&&(C(0,dn,4,0,"table",1)(1,un,15,0,"div",2),S(2,"div",3),r(3,"mat-menu",null,0),We(5,gn,4,0,"ng-template",4),a()),e&2){let o=Kt(4);f(i.cartItems.length>0?0:1),c(2),Ge("left",i.contextMenuPosition.x)("top",i.contextMenuPosition.y),u("matMenuTriggerFor",o)}},dependencies:[A,ni,ii,ei,Oi,hi,vi,_i,fi,bi,ae,z],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc}.table[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(caption) > *[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:12px 10px} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.empty-cart-description[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#c7c7c7}"]})};var fn=(n,t)=>({"text-danger":n,"text-custom-warning":t});function bn(n,t){if(n&1&&(r(0,"mat-option",5)(1,"div",7)(2,"div",8)(3,"div"),s(4),a()()()()),n&2){let e=t.$implicit,i=m();u("value",e),c(2),u("ngClass",Je(4,fn,e.StateID==i.customerState.Suspended,e.StateID==i.customerState.WaitingForApproval))("title",e.StateID==i.customerState.Suspended?"Suspended":e.StateID==i.customerState.WaitingForApproval?"Waiting for Approval":""),c(2),R(e==null?null:e.Value)}}function _n(n,t){if(n&1){let e=F();r(0,"i",9),d("click",function(){b(e);let o=m();return _(o.openCustomerDetail())}),a()}}var _e=class n{httpService=p(J);router=p(Et);customerCtrl=new Ot;customerFiltered$=this.customerCtrl.valueChanges.pipe(P(t=>typeof t=="string"&&t.length>=3),Fe(300),K(t=>this.getCustomerSuggestion(t)));customerSelected$=this.customerCtrl.valueChanges.pipe(P(t=>typeof t!="string"),O(t=>{this.onChange(t)}));createNewCustomer=new V;clickInput=new V;customerState=Di;constructor(){this.customerSelected$.pipe(k()).subscribe()}getCustomerSuggestion(t){return this.httpService.get(L.GetCustomerSuggestions,[{key:"count",value:100},{key:"prefix",value:t}])}displayFn(t){return t?.Value}onCreateCustomer(){this.createNewCustomer.emit()}onClickInputValue(){this.clickInput.emit()}onChange=t=>{};onTouched=()=>{};writeValue(t){this.customerCtrl.patchValue(t,{onlySelf:!0,emitEvent:!1})}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}openCustomerDetail(){let t=this.customerCtrl.value.Key;if(g.IsNotEmpty(t)){let e=this.router.serializeUrl(this.router.createUrlTree(["/menu/Contacts/Contact/Customers/Info"],{queryParams:{ID:t}}));window.open(e,"_blank")}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-customer-autocomplete"]],outputs:{createNewCustomer:"onCreateNewCustomer",clickInput:"onClickInput"},features:[Mt([{provide:ee,multi:!0,useExisting:n}])],decls:9,vars:6,consts:[["auto","matAutocomplete"],[1,"d-flex","align-items-center","position-relative"],["matTooltipPosition","above","matTooltip","New Customer","role","button",1,"fa-light","fa-user-plus","position-absolute","cursor-pointer",2,"font-size","12px",3,"click"],["type","text","placeholder","Assign Customer",3,"click","formControl","matAutocomplete"],[3,"displayWith"],[3,"value"],["matTooltipPosition","left","matTooltip","Open Customer Details",1,"fa-regular","fa-arrow-up-right-from-square","position-absolute"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break",3,"ngClass","title"],["matTooltipPosition","left","matTooltip","Open Customer Details",1,"fa-regular","fa-arrow-up-right-from-square","position-absolute",3,"click"]],template:function(e,i){if(e&1&&(r(0,"div",1)(1,"i",2),d("click",function(){return i.onCreateCustomer()}),a(),r(2,"input",3),d("click",function(){return i.onClickInputValue()}),a(),r(3,"mat-autocomplete",4,0),pt(5,bn,5,7,"mat-option",5,mt),v(7,"async"),a(),C(8,_n,1,0,"i",6),a()),e&2){let o=Kt(4);c(2),u("formControl",i.customerCtrl)("matAutocomplete",o),c(),u("displayWith",i.displayFn),c(2),dt(y(7,4,i.customerFiltered$)),c(3),f(i.customerCtrl&&(i.customerCtrl!=null&&i.customerCtrl.value)&&(!(i.customerCtrl==null||i.customerCtrl.value==null)&&i.customerCtrl.value.Key)?8:-1)}},dependencies:[A,Z,ci,ai,Ze,li,wt,tt,G,Tt,ne,ie,le,Pt],styles:["input[_ngcontent-%COMP%]{width:100%;height:38px!important;border-radius:.375rem;border:1px solid #ced4da;padding-left:32px;padding-right:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i.fa-user-plus[_ngcontent-%COMP%]{font-size:16px;top:12px;left:11px}.text-custom-warning[_ngcontent-%COMP%]{color:#ff7a00d6}i.fa-arrow-up-right-from-square[_ngcontent-%COMP%]{position:absolute;right:13px;top:50%;transform:translateY(-50%);font-size:12px;z-index:2;cursor:pointer}"]})};var Ht=class n{storeService=p(I);dialog=p(nt);httpService=p(J);createNewCustomer(){this.dialog.open(yi,{data:{options:this.storeService.loadForm()?.EstimateOptions,config:this.storeService.loadForm()?.AppConfigJSON?.ModuleContact,type:"customer",title:"New Customer Form"}}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{let e=new ot;e.Key=t.CustomerID,e.Value=t.ContactName,this.storeService.updateCustomer(e)})}onSelectCustomer(t){let e=this.storeService.outlet();this.httpService.get(L.GetCustomerPrivilegeByID,[{key:"ID",value:t.Key},{key:"EntityID",value:e.ID}]).pipe(Ve(()=>{let i=new ot;return this.storeService.updateCustomer(i),Ne})).subscribe(i=>{let o=JSON.parse(JSON.stringify(t));o.PricebookID=i.PricebookID,this.storeService.updateCustomer(o)})}onDeleteCustomer(){g.IsNotEmpty(this.storeService?.customer()?.Key)&&this.dialog.open(Ii,{data:{title:"Re-assign customer",message:"Are you sure to re-assign the customer?"}}).afterClosed().pipe(P(t=>t)).subscribe(()=>{let t=new ot;this.storeService.updateCustomer(t)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var ve=class n{clickEvent=new V;onClick(){this.clickEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-note-button"]],outputs:{clickEvent:"onClickEvent"},decls:2,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"]],template:function(e,i){e&1&&(X(0,"button",0),Dt("click",function(){return i.onClick()}),$e(1,"i",1),at())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function vn(n,t){if(n&1&&(X(0,"div"),s(1),v(2,"number"),at()),n&2){let e=m();c(),x(" ",y(2,1,e.totalAmount)," ")}}function hn(n,t){n&1&&s(0," - ")}var he=class n{payEvent=new V;totalItems=0;totalQuantity=0;totalAmount=0;rolePrice=!0;constructor(){}ngOnInit(){}onPay(){this.payEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-pay-button"]],inputs:{totalItems:"totalItems",totalQuantity:"totalQuantity",totalAmount:"totalAmount",rolePrice:"rolePrice"},outputs:{payEvent:"onPayEvent"},decls:10,vars:5,consts:[["type","button",1,"btn","btn-success","fs-1","py-4","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fs-6"]],template:function(e,i){e&1&&(X(0,"button",0),Dt("click",function(){return i.onPay()}),X(1,"div",1)(2,"div")(3,"span"),s(4,"Submit"),at(),X(5,"small",2),s(6),v(7,"number"),at()(),C(8,vn,3,3,"div")(9,hn,1,0),at()()),e&2&&(c(6),xt(" (",y(7,3,i.totalItems)," Items & ",i.totalQuantity," Qty) "),c(2),f(i.rolePrice?8:9))},dependencies:[A,z],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0;position:relative;flex:1 1 auto;border-left:.1px solid #fff}"]})};var ye=class n{clickEvent=new V;onClick(){this.clickEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-discount-button"]],outputs:{clickEvent:"onClickEvent"},decls:2,vars:0,consts:[["type","button","matTooltip","Discount / Tax","matTooltipPosition","above",1,"btn","btn-success","fs-5",3,"click"],[1,"fa-light","fa-percent"]],template:function(e,i){e&1&&(r(0,"button",0),d("click",function(){return i.onClick()}),S(1,"i",1),a())},dependencies:[ne,ie],styles:["button[_ngcontent-%COMP%]{border-right:.1px solid #fff;border-top-right-radius:0;border-bottom-right-radius:0;position:relative;flex:1 1 auto}"]})};var Ut=class n{store=p(I);toastr=p(te);dialog=p(nt);_backEndService=p(mi);updateState$=B(this.store.complete).pipe(P(t=>t.Success),O(()=>this.store.updateState(3)),k());constructor(){this.updateState$.subscribe()}onPay(){if(this.validatePayOrder()==!1)return;let e={Items:this.cartItemPreSubmission(),Order:N({},this.store.order())};this._backEndService.submitTransaction(e,L.SubmitEstimate).subscribe(i=>{this.store.updateComplete(i)})}cartItemPreSubmission(){let t=JSON.parse(JSON.stringify(this.store.cartItems()));return t=t.map(e=>(delete e.Variant,e)),t}validatePayOrder(){let t=!0;return g.IsEmpty(this.store.outlet().ID)&&(this.toastr.error("Please select outlet before proceeding..",St.Error),t=!1),g.IsEmpty(this.store.customer().Key)&&(this.toastr.warning("Please select a customer!",St.Warning),t=!1),this.store.cartItems().length==0&&(this.toastr.error("You must have at least one item.",St.Error),t=!1),g.IsEmpty(this.store.order().Number)&&(this.toastr.error("Number cannot be empty.",St.Error),t=!1),t}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var xe=class n{constructor(t,e){this.dialogRef=e;this.discountAmount.set(t.discountAmount),this.discount.set(t.discount),this.tax=w(t.tax),this.currency=w(t.currency),this.taxes.set(t.taxes),this.initModalConfig()}modalConfig=new kt;discountAmount=w(0);discount=w(0);tax;discounts=w([0,0,0]);currency;taxes=w([]);initModalConfig(){this.modalConfig.title="Discount and Tax",this.modalConfig.customWidth="400px"}onClose(){this.dialogRef.close()}onSave(){this.dialogRef.close({discountAmount:this.discountAmount(),discount:this.discount(),tax:this.tax()})}onSelectTax(t){this.tax.set(t)}onDiscountCalculatorChange(t,e){let i=this.discounts();i[e]=t,this.discounts.set(i),this.calculateDiscountCalculator()}calculateDiscountCalculator(){let t=this.discounts(),e=100;t.forEach(o=>{o&&o>0&&(e=e*(100-o)/100)});let i=100-e;this.discount.set(i)}static \u0275fac=function(e){return new(e||n)(Y(Vt),Y(At))};static \u0275cmp=M({type:n,selectors:[["app-dialog-discount"]],decls:48,vars:10,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["matTooltipPosition","above","matTooltip","Discount","tabTitle","Discount"],[1,"row","d-flex","align-items-center","justify-content-start"],[1,"col-3"],[1,"fw-bold","d-block"],[1,"col-9"],["type","text","data-cy","discount1","autoNum","","percentage","","decimalPlaces","2",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","ngModel"],[1,"ms-1"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],["type","text","data-cy","discountamount","autoNum","",1,"form-control","d-inline-block",2,"width","100px",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Tax","tabTitle","Tax"],["bindLabel","Label","appendTo","body","bindValue","ID","placeholder","Tax","data-cy","Tax",2,"width","150px",3,"change","clearable","ngModel","items"],["matTooltipPosition","above","matTooltip","Calculation","tabTitle","Calculator"],[1,"row","mt-6","g-0","d-flex","align-items-center","justify-content-start"],[1,"col-4"],[1,"col-8","ps-4"],["type","text","data-cy","discountCal1","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],[1,"mx-2"],["type","text","data-cy","discountCal2","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"],["type","text","data-cy","discountCal3","autoNum","","percentage","",1,"form-control","d-inline-block",2,"width","47px",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),d("keydown.F2",function(){return i.onSave()})("onOk",function(){return i.onSave()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs"),ut(4),r(5,"tab",2)(6,"div",3)(7,"div",4)(8,"label",5),s(9,"Discount %"),a()(),r(10,"div",6)(11,"input",7),Q("ngModelChange",function(l){return j(i.discount,l)||(i.discount=l),l}),a(),r(12,"span",8),s(13,"%"),a()()(),r(14,"div",9)(15,"div",4)(16,"label",5),s(17),a()(),r(18,"div",6)(19,"input",10),Q("ngModelChange",function(l){return j(i.discountAmount,l)||(i.discountAmount=l),l}),a()()()(),gt(),ut(20),r(21,"tab",11)(22,"div",3)(23,"div",4)(24,"label",5),s(25,"Tax"),a()(),r(26,"div",6)(27,"ng-select",12),d("change",function(l){return i.onSelectTax(l)}),a()()()(),gt(),ut(28),r(29,"tab",13)(30,"div",14)(31,"div",15)(32,"label",5),s(33,"Discount Calculator"),a()(),r(34,"div",16)(35,"input",17),d("ngModelChange",function(l){return i.onDiscountCalculatorChange(l,0)}),a(),r(36,"span"),s(37," %"),a(),r(38,"span",18),s(39,"+"),a(),r(40,"input",19),d("ngModelChange",function(l){return i.onDiscountCalculatorChange(l,1)}),a(),r(41,"span"),s(42," %"),a(),r(43,"span",18),s(44,"+"),a(),r(45,"input",20),d("ngModelChange",function(l){return i.onDiscountCalculatorChange(l,2)}),a(),r(46,"span"),s(47," %"),a()()()(),gt(),a()()()()),e&2){let o;u("config",i.modalConfig),c(11),U("ngModel",i.discount),c(6),x("Discount ",(o=i.currency())==null?null:o.Symbol),c(2),U("ngModel",i.discountAmount),c(8),u("clearable",!1)("ngModel",i.tax().ID)("items",i.taxes()),c(8),u("ngModel",i.discounts[0]),c(5),u("ngModel",i.discounts[1]),c(5),u("ngModel",i.discounts[2])}},dependencies:[A,Nt,ce,me,se,it,tt,G,et,Ft,ft],encapsulation:2})};var yt=class n{storeService=p(I);totalItemsQty=q(()=>this.storeService.cartItems().reduce((i,o)=>i+o.Quantity,0));totalItemsAmount=q(()=>this.storeService.cartItems().reduce((i,o)=>i+o.Total,0));taxAmount=q(()=>{let t=this.storeService.tax(),e=0;return t.Rate>0&&(t.CalculationTypeID==1?e=this.calculateTaxInclude(t):e=this.calculateTaxAdd(t)),e});totalAmount=q(()=>{let t=this.storeService.tax(),e=this.storeService.order().DiscountAmount,i=this.storeService.order().Discount,o=this.totalItemsAmount(),l=this.calculatePercentagDisc(i,o),h=o-e-l;return t.CalculationTypeID==0&&(h=h+this.taxAmount()),h});discountPercentageAmount=q(()=>{let t=this.storeService.order().Discount,e=this.totalItemsAmount();return this.calculatePercentagDisc(t,e)});calculateTaxInclude(t){let e=this.grossTotalTaxable();return t.Rate/(100+t.Rate)*e}calculateTaxAdd(t){let e=this.grossTotalTaxable();return t.Rate/100*e}grossTotalTaxable(){let t=this.taxableItems(),e=this.calculateTaxableItemsPrice(),i=this.storeService.discount();if(t.length!==0){let o=this.calculateDiscountTaxableItem();e=e*(100-i.discount)/100,e=e-o}return e}calculateDiscountTaxableItem(){let t=this.taxableItems(),e=this.totalItemsAmount(),i=this.storeService.discount().discountAmount,o=0,l=0,h=0,D=0;for(let W of t)o=W.getItemAfterDiscount/e,l=o*i,D=l*W.Quantity,h+=D;return h}calculatePercentagDisc(t,e){return t/100*e}calculateTaxableItemsPrice(){return this.taxableItems().filter(i=>i.Taxable).reduce((i,o)=>i+o.Total,0)}taxableItems(){return this.storeService.cartItems().filter(e=>e.Taxable)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=T({token:n,factory:n.\u0275fac})};var Sn=n=>({selected:n});function In(n,t){if(n&1){let e=F();r(0,"div",9)(1,"span",14),s(2,"@"),a(),r(3,"input",15),Q("ngModelChange",function(o){b(e);let l=m();return j(l.currency().ExchangeRate,o)||(l.currency().ExchangeRate=o),_(o)}),a()()}if(n&2){let e=m();c(3),U("ngModel",e.currency().ExchangeRate)}}function Dn(n,t){if(n&1){let e=F();r(0,"div",13)(1,"label",16)(2,"input",17),d("ngModelChange",function(){let o=b(e).$implicit,l=m();return _(l.onChangeTag(o.ID))}),a(),s(3),a()()}if(n&2){let e,i=t.$implicit,o=t.$index,l=m();c(),u("for",Oe("potype-"+o))("ngClass",$(7,Sn,((e=l.tag())==null?null:e.ID)==i.ID)),c(),u("id",Oe("potype-"+o))("ngModel",l.tag().ID),c(),x(" ",i.Name," ")}}var Se=class n{constructor(t,e){this.dialogRef=e;this.initModalConfig(),this.currencies.set(t.currencies),this.note.set(t.note),this.tags.set(t.tags),this.tag=w(t.tag),this.currency=w(t.currency),this.defaultCurrencyId=w(t.defaultCurrencyId)}modalConfig=new kt;currencies=w([]);tags=w([]);tag;currency;defaultCurrencyId;note=w("");initModalConfig(){this.modalConfig.title="Order Note",this.modalConfig.customWidth="700px"}onChangeCurrency(t){let e=this.currencies()?.find(i=>i.ID===t);this.currency.set(e)}onChangeTag(t){let e=this.tags()?.find(i=>i.ID===t);this.tag.set(e)}onClose(){this.dialogRef.close()}onSave(){this.dialogRef.close({currency:this.currency(),tag:this.tag(),note:this.note()})}static \u0275fac=function(e){return new(e||n)(Y(Vt),Y(At))};static \u0275cmp=M({type:n,selectors:[["app-dialog-note"]],decls:20,vars:6,consts:[[3,"keydown.F2","onOk","onCancel","onClose","config"],[1,"container"],["matTooltipPosition","above","matTooltip","Notes","tabTitle","Notes"],[3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Currency","tabTitle","Currency"],[1,"row","d-flex","align-items-center","justify-content-start","mt-6"],[1,"row","ms-4"],[1,"ps-0","col-sm-4"],["bindLabel","Name","bindValue","ID","placeholder","Currency","appendTo","body",3,"ngModelChange","items","clearable","ngModel"],[1,"col-sm-4","d-flex"],["matTooltipPosition","above","matTooltip","Tag","tabTitle","Tag"],[1,"row"],[1,"col-12"],[1,"rad-btn"],[1,"pt-4"],["type","text","autoNum","",1,"border","border-light",3,"ngModelChange","ngModel"],[3,"for","ngClass"],["type","radio",3,"ngModelChange","ngModel","id"]],template:function(e,i){if(e&1&&(r(0,"modal-material",0),d("keydown.F2",function(){return i.onSave()})("onOk",function(){return i.onSave()})("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),r(1,"content")(2,"div",1)(3,"custom-tabs"),ut(4),r(5,"tab",2)(6,"POS-tinymce-editor",3),Q("ngModelChange",function(l){return j(i.note,l)||(i.note=l),l}),a()(),gt(),ut(7),r(8,"tab",4)(9,"div",5)(10,"div",6)(11,"div",7)(12,"ng-select",8),d("ngModelChange",function(l){return i.onChangeCurrency(l)}),a()(),C(13,In,4,1,"div",9),a()()(),gt(),ut(14),r(15,"tab",10)(16,"div",11)(17,"div",12),pt(18,Dn,4,9,"div",13,mt),a()()(),gt(),a()()()()),e&2){let o;u("config",i.modalConfig),c(6),U("ngModel",i.note),c(6),u("items",i.currencies())("clearable",!1)("ngModel",i.currency().ID),c(),f(((o=i.currency())==null?null:o.ID)!=i.defaultCurrencyId()?13:-1),c(5),dt(i.tags())}},dependencies:[A,Z,Nt,ce,me,se,it,tt,Ye,G,et,Ft,ft,re],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}"]})};var Ie=class n{onClickEvent=new V;constructor(){}ngOnInit(){}onClick(){this.onClickEvent.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-clear-button"]],outputs:{onClickEvent:"onClickEvent"},decls:3,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"]],template:function(e,i){e&1&&(X(0,"button",0),Dt("click",function(){return i.onClick()}),X(1,"span"),s(2,"Clear"),at()())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function Mn(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2,"Amount"),a(),r(3,"td",12),s(4),v(5,"number"),a()()),n&2){let e=m();c(4),R(y(5,1,e.calculationService==null?null:e.calculationService.totalItemsAmount()))}}function Pn(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2),a(),r(3,"td",13),s(4),v(5,"number"),a()()),n&2){let e=m(2);c(2),x("Discount ",e.storeService==null?null:e.storeService.discount().discount,"%"),c(2),x(" ",y(5,2,e.calculationService.discountPercentageAmount()*-1))}}function En(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2),a(),r(3,"td",13),s(4),v(5,"number"),a()()),n&2){let e,i,o=m(2);c(2),x("Discount ",(e=o.storeService.currency())==null?null:e.Symbol),c(2),x(" ",y(5,2,((i=o.storeService.discount())==null?null:i.discountAmount)*-1))}}function On(n,t){if(n&1&&(r(0,"tr")(1,"th",11),s(2),a(),r(3,"td",12),s(4),v(5,"number"),a()()),n&2){let e,i=m(2);c(2),R((e=i.storeService.tax())==null?null:e.Label),c(2),R(y(5,2,i.calculationService.taxAmount()))}}function Tn(n,t){if(n&1&&(C(0,Pn,6,4,"tr"),C(1,En,6,4,"tr"),C(2,On,6,4,"tr")),n&2){let e,i,o=m();f(o.storeService.discount().discount!=0?0:-1),c(),f(((e=o.storeService.discount())==null?null:e.discountAmount)!=0?1:-1),c(),f(((i=o.storeService.tax())==null?null:i.Rate)!=0?2:-1)}}var De=class n{storeService=p(I);orderService=p(lt);roleService=p(Ct);payService=p(Ut);calculationService=p(yt);cartService=p(ct);dialog=p(nt);taxCalculationType=oe;totalItemsQty=q(()=>this.storeService.cartItems()?.length);isShowAmount=q(()=>this.storeService?.tax()?.CalculationTypeID==0&&this.storeService?.tax()?.Rate||this.storeService.discount()?.discount!=0||this.storeService.discount()?.discountAmount!=0);onOpenDialogNote(){this.dialog.open(Se,{data:{tags:this.storeService.loadForm().SalesOrderTags,currencies:this.storeService.loadForm().Currencies,currency:this.storeService.currency(),tag:this.storeService.tag(),defaultCurrencyId:this.storeService.loadForm()?.AppConfigJSON?.CoreDefaults?.CurrencyID,note:this.storeService.order().Note}}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{this.storeService.updateCurrency(t.currency),this.storeService.updateTag(t.tag),this.storeService.updateOrder(jt(N({},this.storeService.order()),{Note:t.note}))})}onOpenDialogDiscount(){this.dialog.open(xe,{data:{discountAmount:this.storeService.order().DiscountAmount,discount:this.storeService.order().Discount,tax:this.storeService.tax(),currency:this.storeService.currency(),taxes:this.storeService.loadForm().Taxes}}).afterClosed().pipe(P(t=>g.IsNotEmpty(t))).subscribe(t=>{this.storeService.updateDiscount({discountAmount:t.discountAmount,discount:t.discount}),this.storeService.updateTax(t.tax)})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-cart-action"]],decls:13,vars:6,consts:[[1,"row","g-0","px-5","justify-content-end"],[1,"col-6",2,"padding-right","15px"],[1,"table","table-borderless"],[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[2,"flex-grow","1",3,"onClickEvent"],[2,"flex-grow","3",3,"onClickEvent"],[1,"col-7"],[1,"btn-group","w-100"],[1,"d-inline-flex",3,"onClickEvent"],[1,"d-inline-flex","w-100",3,"onPayEvent","rolePrice","totalQuantity","totalItems","totalAmount"],[1,"text-start"],[1,"text-end","fs-5"],[1,"text-end","fs-5","text-danger"]],template:function(e,i){e&1&&(r(0,"div",0)(1,"div",1)(2,"table",2),C(3,Mn,6,3,"tr"),C(4,Tn,3,3),a()()(),r(5,"div",3)(6,"div",4)(7,"app-note-button",5),d("onClickEvent",function(){return i.onOpenDialogNote()}),a(),r(8,"app-clear-button",6),d("onClickEvent",function(){return i.cartService.clearCart()}),a()(),r(9,"div",7)(10,"div",8)(11,"app-discount-button",9),d("onClickEvent",function(){return i.onOpenDialogDiscount()}),a(),r(12,"app-pay-button",10),d("onPayEvent",function(){return i.payService.onPay()}),a()()()()),e&2&&(c(3),f(i.isShowAmount()?3:-1),c(),f(i.calculationService.totalItemsQty()>0?4:-1),c(8),u("rolePrice",i.roleService.product.Price)("totalQuantity",i.calculationService.totalItemsQty())("totalItems",i.totalItemsQty())("totalAmount",i.calculationService.totalAmount()))},dependencies:[A,ye,ve,he,Ie,z],encapsulation:2})};var Vi=n=>({ID:n}),wn=()=>["/menu/Orders/Orders/Estimate/Info"],kn=n=>({"border-top":n});function Nn(n,t){if(n&1&&(r(0,"div",23)(1,"div",28),s(2),a(),r(3,"div",28),s(4),v(5,"number"),a()()),n&2){let e=t.$implicit;c(2),R(e.Name),c(2),x("",y(5,2,e.Total)," ")}}function An(n,t){if(n&1&&(r(0,"div",24)(1,"div",29),s(2),a(),r(3,"div",29),s(4),v(5,"number"),a()()),n&2){let e,i=m();c(2),x("Amount: ",(e=i.storeService.currency())==null?null:e.Symbol),c(2),R(y(5,2,i.calculationService.totalItemsAmount()))}}function Vn(n,t){if(n&1&&(r(0,"div",25)(1,"div",29),s(2),v(3,"number"),a(),r(4,"div",30),s(5),v(6,"number"),a()()),n&2){let e,i=m();c(2),xt("","Discount "+y(3,3,(e=i.storeService.discount())==null?null:e.discount)+" %",": ",(e=i.storeService.currency())==null?null:e.Symbol),c(3),R(y(6,5,i.calculationService.discountPercentageAmount()*-1))}}function Fn(n,t){if(n&1&&(r(0,"div",25)(1,"div",29),s(2),a(),r(3,"div",30),s(4),v(5,"number"),a()()),n&2){let e,i,o=m();c(2),x("Discount: ",(e=o.storeService.currency())==null?null:e.Symbol),c(2),x("",y(5,2,((i=o.storeService.discount())==null?null:i.discountAmount)*-1)," ")}}function Rn(n,t){if(n&1&&(r(0,"div",25)(1,"div",29),s(2),a(),r(3,"div",29),s(4),v(5,"number"),a()()),n&2){let e,i=m();c(2),xt("",(e=i.storeService.tax())==null?null:e.Label,": ",(e=i.storeService.currency())==null?null:e.Symbol),c(2),R(y(5,3,i.calculationService.taxAmount()))}}var Me=class n{orderService=p(lt);calculationService=p(yt);storeService=p(I);isShowAmount=q(()=>this.storeService?.tax()?.CalculationTypeID==0&&this.storeService?.tax()?.Rate||this.storeService.discount()?.discount!=0||this.storeService.discount()?.discountAmount!=0);handleF8(){this.orderService.newOrder()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-complete"]],hostBindings:function(e,i){e&1&&d("keydown.F8",function(){return i.handleF8()},Jt)},decls:41,vars:20,consts:[[1,"pt-7",2,"border-bottom","1px solid rgba(0, 0, 0, 0.1)"],[1,"ps-7","fw-normal","pb-9"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body"],[1,"row",2,"height","115px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","my-6"],["target","_blank","routerLink","/print/Estimate",1,"btn","bg-light-gray","btn-secondary",3,"queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body","py-4"],[1,"row","justify-content-between","border-bottom","py-2"],[1,"row","justify-content-end","mt-2","pb-2"],[1,"row","justify-content-end","pb-2"],[1,"row","justify-content-end","pt-4",3,"ngClass"],[1,"col-4","text-end","h5"],[1,"col","text-end"],[1,"col-4","text-end"],[1,"col-4","text-end","text-danger"]],template:function(e,i){if(e&1&&(r(0,"div",0)(1,"h1",1),s(2,"Estimate"),a()(),r(3,"section",2)(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h1",8),S(10,"i",9),s(11,"Order Complete "),a()(),r(12,"div",10)(13,"div",11)(14,"div",12)(15,"a",13),d("click",function(){return i.orderService.newOrder()}),s(16,"New Order (F8)"),a()()()(),r(17,"div",14)(18,"div",15)(19,"a",16),S(20,"i",17),s(21,"Print Receipt"),a()()()()(),r(22,"div",18)(23,"div",6)(24,"div",19)(25,"h3",20)(26,"a",21),s(27),a()()(),r(28,"div",22),pt(29,Nn,6,4,"div",23,mt),C(31,An,6,4,"div",24),C(32,Vn,7,7,"div",25),C(33,Fn,6,4,"div",25),C(34,Rn,6,5,"div",25),r(35,"div",26)(36,"div",27),s(37),a(),r(38,"div",27),s(39),v(40,"number"),a()()()()()()()()),e&2){let o,l,h,D,W;c(19),u("queryParams",$(13,Vi,i.storeService.complete().OrderID)),c(7),u("routerLink",Yt(15,wn))("queryParams",$(16,Vi,i.storeService.complete().OrderID)),c(),x("Estimate #",(o=i.storeService.complete())==null?null:o.InvoiceNumber),c(2),dt(i.storeService.cartItems()),c(2),f(i.isShowAmount()?31:-1),c(),f(((l=i.storeService.discount())==null?null:l.discount)>0?32:-1),c(),f(((h=i.storeService.discount())==null?null:h.discountAmount)>0?33:-1),c(),f(((D=i.storeService.tax())==null?null:D.Rate)>0?34:-1),c(),u("ngClass",$(18,kn,i.isShowAmount())),c(2),x("Total: ",(W=i.storeService.currency())==null?null:W.Symbol),c(2),R(y(40,11,i.calculationService.totalAmount()))}},dependencies:[A,Z,Zt,Xt,si,z],styles:[".order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}"]})};var Pe=class n{route=p(Et);dialog=p(nt);addItem=new V;handleF8(){this.dialog.openDialogs&&this.dialog.openDialogs.length>0||this.onAddItem()}onAddItem(){this.addItem.emit()}redirectToPrevious(){this.route.navigate(["/menu/Estimate/V1"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["POS-more-action"]],hostBindings:function(e,i){e&1&&d("keydown.F4",function(){return i.handleF8()},Jt)},outputs:{addItem:"onAddItem"},decls:14,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer",3,"click"],["icon","fa-circle-plus fa-solid","label","Add New"]],template:function(e,i){e&1&&(r(0,"span",0)(1,"span",1),S(2,"i",2),a(),r(3,"span",3),s(4,"More Actions"),a()(),r(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"Item"),a(),S(11,"div",9),r(12,"li",10),d("click",function(){return i.onAddItem()}),S(13,"POS-dropdown-item-more-action",11),a()()()()())},dependencies:[Ti],encapsulation:2})};function Bn(n,t){n&1&&S(0,"POS-complete")}function Un(n,t){if(n&1){let e=F();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"POS-select-outlet-form",6),v(6,"async"),d("ngModelChange",function(o){b(e);let l=m();return _(l.outletService.updateOutlet(o))}),a()(),r(7,"POS-invoice-number-form",7),v(8,"async"),d("ngModelChange",function(o){b(e);let l=m();return _(l.orderService.updateOrderNumber(o))}),a(),r(9,"POS-invoice-date",8),d("ngModelChange",function(o){b(e);let l=m();return _(l.orderService.updateOrderDate(o))}),a()()(),r(10,"div",9)(11,"div",10)(12,"div",11)(13,"POS-more-action",12),d("onAddItem",function(){b(e);let o=m();return _(o.cartItemService.onOpenAddDialog())}),a()(),r(14,"div",13)(15,"ng-select-infinite",14,0),v(17,"async"),d("selectedChange",function(o){b(e);let l=m();return _(l.orderService.updateSalesPersonId(o))}),a()()()()(),r(18,"div",15)(19,"div",16)(20,"POS-quick-key",17),v(21,"async"),d("onSelectVariant",function(o){b(e);let l=m();return _(l.cartItemService.onSelectQuickkeyItem(o))}),a()(),r(22,"div",18)(23,"div",19)(24,"div",20),S(25,"POS-variant-autocomplete",21),a(),r(26,"div",13)(27,"POS-customer-autocomplete",22),d("onCreateNewCustomer",function(){b(e);let o=m();return _(o.customerService.createNewCustomer())})("ngModelChange",function(o){b(e);let l=m();return _(l.customerService.onSelectCustomer(o))})("onClickInput",function(){b(e);let o=m();return _(o.customerService.onDeleteCustomer())}),a()()(),r(28,"POS-cart-display",23),v(29,"async"),d("onRemove",function(o){b(e);let l=m();return _(l.cartItemService.removeCartItem(o))})("onEdit",function(o){b(e);let l=m();return _(l.cartItemService.onOpenEditDialog(o))})("onDropItems",function(o){b(e);let l=m();return _(l.cartItemService.onDropItems(o))})("onPurchase",function(o){b(e);let l=m();return _(l.cartItemService.onPurchaseItem(o))})("onReturn",function(o){b(e);let l=m();return _(l.cartItemService.onReturnItem(o))}),a(),S(30,"POS-cart-action"),a()()()}if(n&2){let e,i=m();c(5),u("ngModel",i.storeService.outlet())("outlets",i.storeService.loadForm().Entities)("isOpenAfterLoad",y(6,18,i.outletService.isOpenDialog$)),c(2),u("ngModel",y(8,20,i.orderService.orderNumber$))("isEdit",i.isEditOrder()),c(2),u("ngModel",i.storeService.order().Date)("disabled",!(!(i.role==null||i.role.global==null)&&i.role.global.Date))("tooltip",!(i.role==null||i.role.global==null)&&i.role.global.Date?"":"Date role is required"),c(6),u("clearable",!0)("optionTitle",!0)("items",y(17,22,i.orderService.salesPersons$))("selected",i.storeService.order().SalesID),c(5),u("quickKey",y(21,24,i.quickkeyService.quickkeys$))("outletID",i.storeService.outlet().ID),c(5),u("formControl",i.cartItemService.variantSearchCtrl),c(2),u("ngModel",i.storeService.customer()),c(),u("cartItems",y(29,26,i.cartItemService.cartItems$))("appConfig",(e=i.storeService.loadForm())==null?null:e.AppConfigJSON)}}var Fi=class n extends oi{loadFormService=p(Qt);storeService=p(I);role=p(Ct);outletService=p(Lt);orderService=p(lt);quickkeyService=p(Wt);cartItemService=p(ct);customerService=p(Ht);intercomService=p(Xe);destroyRef=p(je);isCompleteOrder=q(()=>this.storeService.state()==3);isEditOrder=q(()=>this.storeService.state()==1);constructor(t){super(t),this.menuData$.pipe(k(this.destroyRef)).subscribe(),this.intercomService.hideLauncher()}ngOnDestroy(){this.intercomService.showLauncher()}static \u0275fac=function(e){return new(e||n)(Y(ri))};static \u0275cmp=M({type:n,selectors:[["POS-estimate-v2"]],features:[Mt([I,Qt,Lt,lt,Wt,ct,Ht,Ut,yt,_t,ht]),Le],decls:2,vars:1,consts:[["ngSelectInfinite",""],[1,"container-fluid"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex"],[3,"ngModelChange","ngModel","outlets","isOpenAfterLoad"],["transactionType","Estimate",3,"ngModelChange","ngModel","isEdit"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],[3,"onAddItem"],[1,"col-5","ps-0"],["bindValue","ID","bindLabel","Name","placeholder","Assign Sales Person",1,"sales-person","select-max-width",3,"selectedChange","clearable","optionTitle","items","selected"],[1,"row","content"],[1,"col-5","border-end","pt-1"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7","pt-5","px-0","d-flex","flex-column"],[1,"row","w-100","ms-0"],[1,"col-7","px-0"],[3,"formControl"],[3,"onCreateNewCustomer","ngModelChange","onClickInput","ngModel"],[1,"cart-display",3,"onRemove","onEdit","onDropItems","onPurchase","onReturn","cartItems","appConfig"]],template:function(e,i){e&1&&C(0,Bn,1,0,"POS-complete")(1,Un,31,28,"div",1),e&2&&f(i.isCompleteOrder()?0:1)},dependencies:[A,Mi,wt,G,Tt,Pi,it,et,Ci,di,Ei,be,_e,le,pe,De,Me,Pe,Pt],styles:["ng-select-infinite.sales-person.select-max-width>ng-select{padding-right:10px;height:38px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container{font-size:.75rem;border:.5px solid #d7d7d7;padding-right:6px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container>.ng-arrow-wrapper{width:12px;padding-bottom:2px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container>.ng-value-container{padding-left:6px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container{min-height:38px!important;height:38px!important;border:none} ng-select-infinite.sales-person.select-max-width.offline>.ng-select.ng-select-single .ng-select-container{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container .ng-input{padding-left:5px!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single .ng-select-container .ng-input>input{padding-top:5px} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-single>ng-dropdown-panel.ng-dropdown-panel{font-size:.75rem;width:95%!important} ng-select-infinite.sales-person.select-max-width>.ng-select.ng-select-focused .ng-select-container{box-shadow:none!important;border-color:transparent!important}.left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media(max-width:990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}"],changeDetection:0})};export{Fi as EstimateV2Component};
@@ -1 +1 @@
1
- import{a as ve}from"./chunk-GFYUN37C.js";import{a as Ce}from"./chunk-VWU53F6L.js";import{a as fe}from"./chunk-Y3K3NP4V.js";import"./chunk-BYXBJQAS.js";import{f as se,g as ce}from"./chunk-YFB4XBRI.js";import"./chunk-LRM4CXVP.js";import"./chunk-M42U7VID.js";import{a as ue}from"./chunk-U5IOZ6AH.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import"./chunk-LZNSQRCR.js";import"./chunk-BCH2MDJT.js";import"./chunk-INL666X3.js";import"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import{P as k}from"./chunk-5VLBYHUJ.js";import"./chunk-V5VDOLOZ.js";import{a as de,b as pe,c as me}from"./chunk-6RFU4RXC.js";import"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import{b as ae,c as le}from"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import"./chunk-FMECWSCG.js";import{D as oe,E as te,F as ne,c as J,e as h,h as Y,i as X,p as Q,v as Z,w as ee}from"./chunk-QMS2MBIA.js";import"./chunk-YAH623GO.js";import"./chunk-SFKUAKOZ.js";import"./chunk-WLVEHCCR.js";import{b as re}from"./chunk-P7GOTTNS.js";import{a as F}from"./chunk-3DEA4WWC.js";import"./chunk-JWOMTKKN.js";import{n as z,q as ie}from"./chunk-3GXUD7K4.js";import{Bb as m,Db as u,Dc as b,Eb as O,Ec as q,F as T,Fa as V,Gb as U,Hb as H,Ib as p,Jb as i,Kb as r,Lb as c,Qc as K,Rb as $,Rd as W,Tc as L,Ub as G,Xb as v,Za as l,Zb as C,eb as f,hc as j,ib as y,mc as a,md as R,nb as A,nc as x,ob as I,oc as w,ra as _,rd as B,u as D,va as P,wa as E,zd as M}from"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var N=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function ye(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new ae,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=_(de);config;fb=_(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[h.required]],validateCoupon:[this.data?.validateCoupon||"",[h.required]],redeemCoupon:[this.data?.redeemCoupon||"",[h.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[h.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(f(pe))};static \u0275cmp=y({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),c(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),c(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),c(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),c(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,ye,2,0,"div",20),r(),i(30,"div",23),c(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",b(10,N,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),u(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",b(12,N,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),u(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",b(14,N,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),u(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",b(16,N,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),u(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,ee,Z,le,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var xe=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Re(n,d){if(n&1){let e=G();i(0,"button",10),v("click",function(){P(e);let t=C();return E(t.addNewCouponProvider())}),a(1," Add "),r()}}function Me(n,d){n&1&&c(0,"th",8)}function Ne(n,d){if(n&1){let e=G();i(0,"td",11)(1,"i",14),v("click",function(){P(e);let t=C().$index,s=C(2);return E(s.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=G();i(0,"tr"),m(1,Ne,2,0,"td",11),i(2,"td")(3,"a",12),v("click",function(){let t=P(e),s=t.$implicit,g=t.$index,_e=C(2);return E(_e.onUpdateProvider(s,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",13),a(13),r()()()}if(n&2){let e=d.$implicit,o=C(2);l(),u(o.role.developer.Edit?1:-1),l(3),w(" ",e.Name," "),l(2),x(e.ValidateCoupon),l(2),x(e.RedeemCoupon),l(2),x(e.KeyUI),l(2),p("ngClass",q(7,xe,e.Enabled,!e.Enabled)),l(),w(" ",e.Enabled?"Enabled":"Disabled"," ")}}function Ie(n,d){if(n&1&&U(0,Te,14,10,"tr",null,O),n&2){let e=C();H(e.listProviders())}}function we(n,d){n&1&&$(0)}function Fe(n,d){if(n&1&&I(0,we,1,0,"ng-container",15),n&2){C();let e=j(25);p("ngTemplateOutlet",e)}}function ke(n,d){n&1&&(i(0,"tr",16)(1,"td",17),c(2,"empty-state-table"),r()())}var ge=class n extends Ce{constructor(e,o,t,s,g){super(e,o,k.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=s;this.dialog=g}toastr=_(z);couponProviders=V([]);listProviders=L(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(T(e=>F.IsNotEmpty(e)),D(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(T(t=>F.IsNotEmpty(t))).subscribe(t=>{let s={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=s,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(k.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(f(ue),f(ie),f(W),f(re),f(me))};static \u0275cmp=y({type:n,selectors:[["app-coupon-configuration"]],features:[A],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Re,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Me,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,Ie,2,0)(23,Fe,1,1,"ng-container"),r()()()()(),I(24,ke,3,0,"ng-template",null,0,K),r()()),o&2){let s;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),u(t.role.developer.Edit?2:-1),l(8),u(t.role.developer.Edit?10:-1),l(12),u(((s=t.listProviders())==null?null:s.length)>0?22:23)}},dependencies:[M,R,B,ce,se,te,fe],encapsulation:2})};export{ge as CouponConfigurationComponent};
1
+ import{a as ve}from"./chunk-GFYUN37C.js";import{a as Ce}from"./chunk-VWU53F6L.js";import{a as fe}from"./chunk-Y3K3NP4V.js";import"./chunk-BYXBJQAS.js";import{f as se,g as ce}from"./chunk-STTYRDAE.js";import"./chunk-QFFTSYQT.js";import"./chunk-M42U7VID.js";import{a as ue}from"./chunk-ZEQ236EM.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import"./chunk-LZNSQRCR.js";import"./chunk-BCH2MDJT.js";import"./chunk-INL666X3.js";import"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import{P as k}from"./chunk-5VLBYHUJ.js";import"./chunk-V5VDOLOZ.js";import{a as de,b as pe,c as me}from"./chunk-6RFU4RXC.js";import"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import{b as ae,c as le}from"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import"./chunk-FMECWSCG.js";import{D as oe,E as te,F as ne,c as J,e as h,h as Y,i as X,p as Q,v as Z,w as ee}from"./chunk-QMS2MBIA.js";import"./chunk-HM3ZQECL.js";import"./chunk-TA33BFJL.js";import"./chunk-WLVEHCCR.js";import{b as re}from"./chunk-P7GOTTNS.js";import{a as F}from"./chunk-3DEA4WWC.js";import"./chunk-PS3OAEKV.js";import{n as z,q as ie}from"./chunk-3GXUD7K4.js";import{Bb as m,Db as u,Dc as b,Eb as O,Ec as q,F as T,Fa as V,Gb as U,Hb as H,Ib as p,Jb as i,Kb as r,Lb as c,Qc as K,Rb as $,Rd as W,Tc as L,Ub as G,Xb as v,Za as l,Zb as C,eb as f,hc as j,ib as y,mc as a,md as R,nb as A,nc as x,ob as I,oc as w,ra as _,rd as B,u as D,va as P,wa as E,zd as M}from"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var N=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function ye(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new ae,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=_(de);config;fb=_(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[h.required]],validateCoupon:[this.data?.validateCoupon||"",[h.required]],redeemCoupon:[this.data?.redeemCoupon||"",[h.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[h.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(f(pe))};static \u0275cmp=y({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),c(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),c(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),c(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),c(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,ye,2,0,"div",20),r(),i(30,"div",23),c(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",b(10,N,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),u(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",b(12,N,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),u(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",b(14,N,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),u(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",b(16,N,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),u(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,ee,Z,le,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var xe=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Re(n,d){if(n&1){let e=G();i(0,"button",10),v("click",function(){P(e);let t=C();return E(t.addNewCouponProvider())}),a(1," Add "),r()}}function Me(n,d){n&1&&c(0,"th",8)}function Ne(n,d){if(n&1){let e=G();i(0,"td",11)(1,"i",14),v("click",function(){P(e);let t=C().$index,s=C(2);return E(s.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=G();i(0,"tr"),m(1,Ne,2,0,"td",11),i(2,"td")(3,"a",12),v("click",function(){let t=P(e),s=t.$implicit,g=t.$index,_e=C(2);return E(_e.onUpdateProvider(s,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",13),a(13),r()()()}if(n&2){let e=d.$implicit,o=C(2);l(),u(o.role.developer.Edit?1:-1),l(3),w(" ",e.Name," "),l(2),x(e.ValidateCoupon),l(2),x(e.RedeemCoupon),l(2),x(e.KeyUI),l(2),p("ngClass",q(7,xe,e.Enabled,!e.Enabled)),l(),w(" ",e.Enabled?"Enabled":"Disabled"," ")}}function Ie(n,d){if(n&1&&U(0,Te,14,10,"tr",null,O),n&2){let e=C();H(e.listProviders())}}function we(n,d){n&1&&$(0)}function Fe(n,d){if(n&1&&I(0,we,1,0,"ng-container",15),n&2){C();let e=j(25);p("ngTemplateOutlet",e)}}function ke(n,d){n&1&&(i(0,"tr",16)(1,"td",17),c(2,"empty-state-table"),r()())}var ge=class n extends Ce{constructor(e,o,t,s,g){super(e,o,k.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=s;this.dialog=g}toastr=_(z);couponProviders=V([]);listProviders=L(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(T(e=>F.IsNotEmpty(e)),D(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(T(t=>F.IsNotEmpty(t))).subscribe(t=>{let s={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=s,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(k.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(f(ue),f(ie),f(W),f(re),f(me))};static \u0275cmp=y({type:n,selectors:[["app-coupon-configuration"]],features:[A],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Re,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Me,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,Ie,2,0)(23,Fe,1,1,"ng-container"),r()()()()(),I(24,ke,3,0,"ng-template",null,0,K),r()()),o&2){let s;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),u(t.role.developer.Edit?2:-1),l(8),u(t.role.developer.Edit?10:-1),l(12),u(((s=t.listProviders())==null?null:s.length)>0?22:23)}},dependencies:[M,R,B,ce,se,te,fe],encapsulation:2})};export{ge as CouponConfigurationComponent};
@@ -1 +1 @@
1
- import{b as a}from"./chunk-GO5NVTB3.js";import"./chunk-6SXYT7FK.js";import"./chunk-M6PMDWRR.js";import"./chunk-3KNAOUQW.js";import"./chunk-2XVBPKJM.js";import"./chunk-J5EG5QTU.js";import"./chunk-ESZK4YUA.js";import"./chunk-LHUG6IEF.js";import"./chunk-VC6QLCUC.js";import"./chunk-UNPNX2VJ.js";import"./chunk-A5FQDC3G.js";import"./chunk-OEZWD2O3.js";import"./chunk-VWU53F6L.js";import"./chunk-YGTSYNJ4.js";import"./chunk-NOF55KZZ.js";import"./chunk-NEKBV3FU.js";import"./chunk-BW3AS55J.js";import"./chunk-LPFB4TBW.js";import"./chunk-YECO23BV.js";import"./chunk-I4A4FBK3.js";import"./chunk-ZYWSPXDH.js";import"./chunk-P3KIIKY4.js";import"./chunk-CSFBLJDG.js";import"./chunk-YGI2CFJK.js";import"./chunk-XOJZGUT3.js";import"./chunk-Y3K3NP4V.js";import"./chunk-BYXBJQAS.js";import"./chunk-XV3LZZ5N.js";import"./chunk-KA2ONH4O.js";import"./chunk-LU2TRITM.js";import"./chunk-TPHMHUJE.js";import"./chunk-NB2TBERF.js";import"./chunk-CIDPGJ5I.js";import"./chunk-6FI765LW.js";import"./chunk-3XXHI4EL.js";import"./chunk-OFAMZL4W.js";import"./chunk-PRC6BIGW.js";import"./chunk-XRHB5YFU.js";import"./chunk-JGRL2V64.js";import"./chunk-77OYJ25Y.js";import"./chunk-IGAEFS7B.js";import"./chunk-4M7RPVWV.js";import"./chunk-DU3EU6UY.js";import"./chunk-5FZQUUGO.js";import"./chunk-W2DHHNBD.js";import"./chunk-MVXEAR7T.js";import"./chunk-VH3BBWAO.js";import"./chunk-OX2RZSIO.js";import"./chunk-4OXYU3IN.js";import"./chunk-S5D6TMC7.js";import"./chunk-EZCVGBAR.js";import"./chunk-BONQYLII.js";import"./chunk-GQLZJQI6.js";import"./chunk-JYCI6IOX.js";import"./chunk-YFB4XBRI.js";import"./chunk-WQ627RLB.js";import"./chunk-Y2ST6F4K.js";import"./chunk-YQH2QORC.js";import"./chunk-Z3E6ZNA3.js";import"./chunk-KCKWSNMS.js";import"./chunk-IEXCLXA2.js";import"./chunk-GOPYUSW4.js";import"./chunk-ZAPREM3S.js";import"./chunk-QWL5S2RG.js";import"./chunk-7TPO6NBM.js";import"./chunk-NS5MW6GH.js";import"./chunk-X36HAWOW.js";import"./chunk-2B2L2JOP.js";import"./chunk-N76EALXO.js";import"./chunk-UL6HUKIC.js";import"./chunk-NLFBNSNG.js";import"./chunk-LRM4CXVP.js";import"./chunk-M42U7VID.js";import"./chunk-U5IOZ6AH.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import"./chunk-LZNSQRCR.js";import"./chunk-BCH2MDJT.js";import"./chunk-INL666X3.js";import"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import"./chunk-5VLBYHUJ.js";import"./chunk-5UKWQA6U.js";import"./chunk-QYSFCWV7.js";import"./chunk-Q7OVBNEW.js";import"./chunk-V5VDOLOZ.js";import"./chunk-6RFU4RXC.js";import"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import"./chunk-PG5RORVW.js";import"./chunk-OQDKFI6M.js";import"./chunk-TKBQO5Z6.js";import"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import"./chunk-FMECWSCG.js";import"./chunk-QMS2MBIA.js";import"./chunk-YAH623GO.js";import"./chunk-SFKUAKOZ.js";import"./chunk-WLVEHCCR.js";import"./chunk-P7GOTTNS.js";import"./chunk-3DEA4WWC.js";import"./chunk-JWOMTKKN.js";import"./chunk-3GXUD7K4.js";import"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";export{a as ContactsModule};
1
+ import{b as a}from"./chunk-S4L5E7IE.js";import"./chunk-6SXYT7FK.js";import"./chunk-BPGYEPLG.js";import"./chunk-3KNAOUQW.js";import"./chunk-2XVBPKJM.js";import"./chunk-J5EG5QTU.js";import"./chunk-ESZK4YUA.js";import"./chunk-LHUG6IEF.js";import"./chunk-VC6QLCUC.js";import"./chunk-UNPNX2VJ.js";import"./chunk-67UZ2CAI.js";import"./chunk-OEZWD2O3.js";import"./chunk-VWU53F6L.js";import"./chunk-YGTSYNJ4.js";import"./chunk-NOF55KZZ.js";import"./chunk-NEKBV3FU.js";import"./chunk-BW3AS55J.js";import"./chunk-LPFB4TBW.js";import"./chunk-YECO23BV.js";import"./chunk-I4A4FBK3.js";import"./chunk-ZYWSPXDH.js";import"./chunk-P3KIIKY4.js";import"./chunk-CSFBLJDG.js";import"./chunk-YGI2CFJK.js";import"./chunk-XOJZGUT3.js";import"./chunk-Y3K3NP4V.js";import"./chunk-BYXBJQAS.js";import"./chunk-XV3LZZ5N.js";import"./chunk-KA2ONH4O.js";import"./chunk-LU2TRITM.js";import"./chunk-TPHMHUJE.js";import"./chunk-NB2TBERF.js";import"./chunk-CIDPGJ5I.js";import"./chunk-6FI765LW.js";import"./chunk-3XXHI4EL.js";import"./chunk-OFAMZL4W.js";import"./chunk-PRC6BIGW.js";import"./chunk-XRHB5YFU.js";import"./chunk-JGRL2V64.js";import"./chunk-77OYJ25Y.js";import"./chunk-IGAEFS7B.js";import"./chunk-4M7RPVWV.js";import"./chunk-DU3EU6UY.js";import"./chunk-5FZQUUGO.js";import"./chunk-W2DHHNBD.js";import"./chunk-MVXEAR7T.js";import"./chunk-VH3BBWAO.js";import"./chunk-OX2RZSIO.js";import"./chunk-4OXYU3IN.js";import"./chunk-S5D6TMC7.js";import"./chunk-OF5JVNNQ.js";import"./chunk-OHUE6LJN.js";import"./chunk-GQLZJQI6.js";import"./chunk-JYCI6IOX.js";import"./chunk-STTYRDAE.js";import"./chunk-WQ627RLB.js";import"./chunk-Y2ST6F4K.js";import"./chunk-YQH2QORC.js";import"./chunk-Z3E6ZNA3.js";import"./chunk-KCKWSNMS.js";import"./chunk-IEXCLXA2.js";import"./chunk-GOPYUSW4.js";import"./chunk-ZAPREM3S.js";import"./chunk-QWL5S2RG.js";import"./chunk-7TPO6NBM.js";import"./chunk-NS5MW6GH.js";import"./chunk-X36HAWOW.js";import"./chunk-2B2L2JOP.js";import"./chunk-N76EALXO.js";import"./chunk-UL6HUKIC.js";import"./chunk-NLFBNSNG.js";import"./chunk-QFFTSYQT.js";import"./chunk-M42U7VID.js";import"./chunk-ZEQ236EM.js";import"./chunk-HRIVC724.js";import"./chunk-DTQAQRLJ.js";import"./chunk-LZNSQRCR.js";import"./chunk-BCH2MDJT.js";import"./chunk-INL666X3.js";import"./chunk-UUAZGIAN.js";import"./chunk-SPPZGYU7.js";import"./chunk-DYDRVXX3.js";import"./chunk-FICGNDPR.js";import"./chunk-2BQQJ3YS.js";import"./chunk-YNQPX5G6.js";import"./chunk-5VLBYHUJ.js";import"./chunk-5UKWQA6U.js";import"./chunk-QYSFCWV7.js";import"./chunk-Q7OVBNEW.js";import"./chunk-V5VDOLOZ.js";import"./chunk-6RFU4RXC.js";import"./chunk-YCV6GUTW.js";import"./chunk-VXGIPE22.js";import"./chunk-PG5RORVW.js";import"./chunk-OQDKFI6M.js";import"./chunk-TKBQO5Z6.js";import"./chunk-M5BHFFPW.js";import"./chunk-XUQHA7FY.js";import"./chunk-AJ6OO7CP.js";import"./chunk-UPAKGSOK.js";import"./chunk-FMECWSCG.js";import"./chunk-QMS2MBIA.js";import"./chunk-HM3ZQECL.js";import"./chunk-TA33BFJL.js";import"./chunk-WLVEHCCR.js";import"./chunk-P7GOTTNS.js";import"./chunk-3DEA4WWC.js";import"./chunk-PS3OAEKV.js";import"./chunk-3GXUD7K4.js";import"./chunk-NGFIIVK5.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";export{a as ContactsModule};