PageSourceSearch

https://mdsoftball.com/chunk-QXN4PBMJ.js

js mdsoftball.com collected 2026-10-10 00:30:29 UTC 36,165 bytes, 1 lines download raw bytes

1import{a as ce}from"./chunk-KI7LHDGG.js";import{a as me}from"./chunk-NCWVOULH.js";import{a as de,b as wt,c as yt}from"./chunk-2YBWYHWY.js";import{a as St,b as bt}from"./chunk-2MTX7SPE.js";import{b as mt,c as ct,d as st,f as pt,g as ut,i as gt,j as ft,l as _t,m as ht,o as xt,q as Ct}from"./chunk-KRTSLQMF.js";import{b as dt}from"./chunk-3OVFN422.js";import{b as ae,c as nt,e as ot,g as rt,h as at,i as lt,j as le}from"./chunk-ZO6XVO5J.js";import"./chunk-6MO4MEQP.js";import"./chunk-B7B5WM7T.js";import"./chunk-UGDLC6EV.js";import"./chunk-B5NEAK4C.js";import"./chunk-YC2LQGWC.js";import"./chunk-AVUIAMLN.js";import{d as vt}from"./chunk-OB5AWC5K.js";import"./chunk-PVDG46DZ.js";import{a as it}from"./chunk-HE3DNVQH.js";import"./chunk-MS4AQ6UA.js";import{b as oe,d as re}from"./chunk-XHUJPQ2Y.js";import{f as ne}from"./chunk-NDUJRHP7.js";import"./chunk-CS3C5SJ4.js";import"./chunk-CWKOEHTM.js";import"./chunk-OHFU4JPE.js";import{d as Qe,g as Je}from"./chunk-ZQ4ABVVC.js";import"./chunk-43LBX2TZ.js";import"./chunk-LLJMB2O3.js";import{b as q,c as K}from"./chunk-M55ZOPUC.js";import"./chunk-RHPCBB4E.js";import{a as D,h as Ye,i as Ze,k as ge,l as fe,m as et,r as tt}from"./chunk-7QXOYBX4.js";import{d as Ne,e as Ue,f as ze,g as Ae,h as je,i as He,j as qe,k as A}from"./chunk-LMSH4NZU.js";import"./chunk-H2EPDQE7.js";import"./chunk-3NIFDC2L.js";import"./chunk-HMYTTUL2.js";import{a as te,b as ie}from"./chunk-BSLSRQA6.js";import"./chunk-Q2JHDKJO.js";import"./chunk-4AODPZAV.js";import"./chunk-PZRKOE6X.js";import{a as G,b as Ge,d as Q,e as J,i as X,j as Y}from"./chunk-7REHTKXJ.js";import"./chunk-M4IR63WT.js";import{l as Ke,n as j,q as H}from"./chunk-YJ7YIWGB.js";import{l as Xe}from"./chunk-IBDXLMOX.js";import"./chunk-VC5P3N6Z.js";import"./chunk-2QHMWW4R.js";import{T as Z,U as ee,x as $e}from"./chunk-MN7B4JTZ.js";import"./chunk-FR6RKWXX.js";import"./chunk-6KZZVMZI.js";import{F as We,G as z,H as Be,c as $,e as _,h as N,i as Ve,m as Fe,n as De,o as U,r as Re,t as Oe}from"./chunk-SEB67MME.js";import{B as Le,F as B,r as Te}from"./chunk-2JLYSLH6.js";import{$a as I,$b as Me,Db as be,Eb as we,Fa as k,Fb as ye,Ib as o,Jb as f,Kb as y,Rb as C,Sa as xe,Sb as v,Tb as S,Wa as T,Xa as L,Za as P,_a as E,aa as ue,ab as u,ac as Pe,bb as i,bc as Ee,cb as n,db as g,ga as d,hb as V,ib as F,kb as w,kc as Ie,mc as ke,p as s,q as p,qb as h,sa as b,tb as c,xb as Ce,yb as ve,za as W,zb as Se}from"./chunk-7SVB7TYI.js";import{f as he,fa as M}from"./chunk-DUAIDAS6.js";import{a as R,b as O}from"./chunk-ZOCHBAGS.js";function Wt(a,m){if(a&1&&(i(0,"mat-option",22),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),y(" ",e," ")}}function Bt(a,m){if(a&1&&(i(0,"mat-option",22),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),y(" ",e," ")}}function $t(a,m){if(a&1&&(i(0,"mat-option",22),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),y(" ",e," ")}}function Nt(a,m){if(a&1){let e=w();i(0,"mat-chip-row",43),h("removed",function(){let t=s(e).$implicit,l=c();return p(l.removeTag(t))}),o(1),i(2,"button",44)(3,"mat-icon"),o(4,"cancel"),n()()()}if(a&2){let e=m.$implicit;d(),y(" ",e," ")}}function Ut(a,m){if(a&1&&(i(0,"mat-option",22),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),y(" ",e," ")}}var _e=(()=>{class a{fb;dialogRef;productService;data;productForm;isEditMode=!1;tags=[];separatorKeysCodes=[13,188];categories=[];brands=[];vendors=[];weightUnits=["lbs","kg","oz","g"];constructor(e,r,t,l){this.fb=e,this.dialogRef=r,this.productService=t,this.data=l,this.isEditMode=l.mode==="edit"}ngOnInit(){this.loadDropdownData(),this.initializeForm(),this.data.product&&this.patchFormValues(this.data.product)}loadDropdownData(){this.productService.getCategories().subscribe(e=>{this.categories=e}),this.productService.getBrands().subscribe(e=>{this.brands=e}),this.productService.getVendors().subscribe(e=>{this.vendors=e})}initializeForm(){this.productForm=this.fb.group({sku:["",[_.required,_.maxLength(50)]],name:["",[_.required,_.maxLength(200)]],description:["",_.maxLength(1e3)],barcode:["",_.maxLength(50)],category:["",_.required],brand:[""],vendor:[""],cost:[0,[_.required,_.min(0)]],basePrice:[0,[_.required,_.min(0)]],price:[0,[_.required,_.min(0)]],tax:[0,[_.required,_.min(0),_.max(100)]],weight:[0,_.min(0)],weightUnit:["lbs"],stock:[0,[_.required,_.min(0)]],reserved:[0,[_.min(0)]],imageUrl:["",_.pattern(/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/)],active:[!0]}),this.productForm.get("basePrice")?.valueChanges.subscribe(()=>this.calculatePrice()),this.productForm.get("tax")?.valueChanges.subscribe(()=>this.calculatePrice())}patchFormValues(e){this.productForm.patchValue({sku:e.sku,name:e.name,description:e.description,barcode:e.barcode,category:e.category,brand:e.brand,vendor:e.vend
1or,cost:e.cost,basePrice:e.basePrice,price:e.price,tax:e.tax,weight:e.weight,weightUnit:e.weightUnit||"lbs",stock:e.stock,reserved:e.reserved,imageUrl:e.imageUrl,active:e.active}),e.tags&&(this.tags=[...e.tags])}calculatePrice(){let e=this.productForm.get("basePrice")?.value||0,r=this.productForm.get("tax")?.value||0,t=e*(1+r/100);this.productForm.patchValue({price:t},{emitEvent:!1})}addTag(e){let r=(e.value||"").trim();r&&!this.tags.includes(r)&&this.tags.push(r),e.chipInput.clear()}removeTag(e){let r=this.tags.indexOf(e);r>=0&&this.tags.splice(r,1)}onSubmit(){if(this.productForm.valid){let e=this.productForm.value,r=O(R({},e),{tags:this.tags,id:this.data.product?.id});this.dialogRef.close(r)}else Object.keys(this.productForm.controls).forEach(e=>{let r=this.productForm.get(e);r?.invalid&&r.markAsTouched()})}onCancel(){this.dialogRef.close()}getErrorMessage(e){let r=this.productForm.get(e);return r?.hasError("required")?"This field is required":r?.hasError("min")?`Minimum value is ${r.errors?.min.min}`:r?.hasError("max")?`Maximum value is ${r.errors?.max.max}`:r?.hasError("maxLength")?`Maximum length is ${r.errors?.maxLength.requiredLength}`:r?.hasError("pattern")?"Invalid format":""}static \u0275fac=function(r){return new(r||a)(b(We),b(Ne),b(ce),b(Ue))};static \u0275cmp=W({type:a,selectors:[["app-product-form-dialog"]],decls:184,vars:20,consts:[["chipGrid",""],[1,"px-8","py-12","grey-300",2,"display","flex","justify-content","space-between","align-items","center"],["mat-dialog-title","",1,"font-size-16","bold"],[2,"color","#3f51b5"],[1,"pl-8"],[1,"material-icons","link",3,"mat-dialog-close"],[2,"padding","24px"],[2,"display","flex","flex-direction","column","gap","16px",3,"formGroup"],[1,"form-section"],[2,"margin","0 0 16px 0","color","#666","font-size","14px","font-weight","600","text-transform","uppercase"],[1,"form-row",2,"display","grid","grid-template-columns","1fr 1fr","gap","16px"],["appearance","outline"],["matInput","","formControlName","name","placeholder","Enter product name"],["matSuffix",""],["matInput","","formControlName","sku","placeholder","Enter SKU"],[1,"form-row"],["appearance","outline",2,"width","100%"],["matInput","","formControlName","description","rows","3","placeholder","Enter product description"],["matInput","","formControlName","barcode","placeholder","Enter barcode"],["matInput","","formControlName","imageUrl","placeholder","https://example.com/image.jpg"],[1,"form-row",2,"display","grid","grid-template-columns","1fr 1fr 1fr","gap","16px"],["formControlName","category"],[3,"value"],["matTextPrefix",""],["formControlName","brand"],["value",""],["formControlName","vendor"],["placeholder","Add tags...",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"form-row",2,"display","grid","grid-template-columns","1fr 1fr 1fr 1fr","gap","16px"],["appearance","outline",1,"custom-form-field"],["matInput","","type","number","formControlName","cost","placeholder","0.00"],["matTextSuffix",""],["matInput","","type","number","formControlName","basePrice","placeholder","0.00"],["matInput","","type","number","formControlName","tax","placeholder","0"],["matInput","","type","number","formControlName","price","placeholder","0.00","readonly",""],["matInput","","type","number","formControlName","stock","placeholder","0"],["matInput","","type","number","formControlName","reserved","placeholder","0"],["matInput","","type","number","formControlName","weight","placeholder","0","step","0.01"],["formControlName","weightUnit"],["formControlName","active","color","primary"],["align","end",2,"padding","16px 24px","border-top","1px solid #e0e0e0","gap","12px"],["mat-button","",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"removed"],["matChipRemove",""]],template:function(r,t){if(r&1){let l=w();i(0,"div",1)(1,"div",2)(2,"mat-icon",3),o(3),n(),i(4,"span",4),o(5),n()(),i(6,"span",5),o(7," close "),n()(),i(8,"mat-dialog-content",6)(9,"form",7)(10,"div",8)(11,"h3",9),o(12," Basic Information "),n(),i(13,"div",10)(14,"mat-form-field",11)(15,"mat-label"),o(16,"Product Name *"),n(),g(17,"input",12),i(18,"mat-icon",13),o(19,"label"),n(),i(20,"mat-error"),o(21),n()(),i(22,"mat-form-field",11)(23,"mat-label"),o(24,"SKU *"),n(),g(25,"input",14),i(26,"mat-icon",13),o(27,"qr_code"),n(),i(28,"mat-error"),o(29),n()()(),i(30,"div",15)(31,"mat-form-field",16)(32,"mat-label"),o(33,"Description"),n(),g(34,"textarea",17),i(35,"mat-icon",13),o(36,"description"),n(),i(37,"mat-error"),o(38),n()()(),i(39,"div",10)(40,"mat-form-field",11)(41,"mat-label"),o(42,"Barcode"),n(),g(43,"input",18),i(44,"mat-icon",13),o(45,"barcode"),n()(),i(46,"mat-form-field",11)(47,"mat-label"),o(48,"Image URL"),n(),g(49,"input",19),i(50,"mat-icon",13),o(51,"image"),n(),i(52,"mat-error"),o(53),n()()()(),i(54,"div",8)(55,"h3",9),o(56," Categorization "),n(),i(57,"div",20)(58,"mat-form-field",11)(59,"mat-label"),o(60,"Category *"),n(),i(61,"mat-select",21),E(62,Wt,2,2,"mat-option",22,P),n(),i(64,"mat-icon",23),o(65,"category"),n(),i(66,"mat-error"),o(67),n()(),i(68,"mat-form-field",11)(69,"mat-label"),o(70,"Brand"),n(),i(71,"mat-select",24)(72,"mat-option",25),o(73,"None"),n(),E(74,Bt,2,2,"mat-option",22,P),n(),i(76,"mat-icon",23),o(77,"business"),n()(),i(78,"mat-form-field",11)(79,"mat-label"),o(80,"Vendor"),n(),i(81,"mat-select",26)(82,"mat-option",25),o(83,"None"),n(),E(84,$t,2,2,"mat-option",22,P),n(),i(86,"mat-icon",23),o(87,"store"),n()()(),i(88,"div",15)(89,"mat-form-field",16)(90,"mat-label"),o(91,"Tags"),n(),i(92,"mat-chip-grid",null,0),E(94,Nt,5,1,"mat-chip-row",null,P),n(),i(96,"input",27),h("matChipInputTokenEnd",function(se){return s(l),p(t.addTag(se))}),n(),i(97,"mat-icon",23),o(98,"local_offer"),n()()()(),i(99,"div",8)(100,"h3",9),o(101," Pricing "),n(),i(102,"div",28)(103,"mat-form-field",29)(104,"mat-label"),o(105,"Cost *"),n(),g(106,"input",30),i(107,"span",23),o(108,"$\xA0"),n(),i(109,"span",31),o(110,".00"),n(),i(111,"mat-error"),o(112),n()(),i(113,"mat-form-field",11)(114,"mat-label"),o(115,"Base Price *"),n(),g(116,"input",32),i(117,"span",23),o(118,"$"),n(),i(119,"mat-error"),o(120),n()(),i(121,"mat-form-field",11)(122,"mat-label"),o(123,"Tax % *"),n(),g(124,"input",33),i(125,"span",31),o(126,"%"),n(),i(127,"mat-error"),o(128),n()(),i(129,"mat-form-field",11)(130,"mat-label"),o(131,"Final Price *"),n(),g(132,"input",34),i(133,"span",23),o(134,"$"),n(),i(135,"mat-error"),o(136),n()()()(),i(137,"div",8)(138,"h3",9),o(139," Inventory "),n(),i(140,"div",28)(141,"mat-form-field",11)(142,"mat-label"),o(143,"Stock *"),n(),g(144,"input",35),i(145,"mat-icon",23),o(146,"inventory"),n(),i(147,"mat-error"),o(148),n()(),i(149,"mat-form-field",11)(150,"mat-label"),o(151,"Reserved"),n(),g(152,"input",36),i(153,"mat-icon",23),o(154,"lock"),n(),i(155,"mat-error"),o(156),n()(),i(157,"mat-form-field",11)(158,"mat-label"),o(159,"Weight"),n(),g(160,"input",37),i(161,"mat-icon",23),o(162,"scale"),n(),i(163,"mat-error"),o(164),n()(),i(165,"mat-form-field",11)(166,"mat-label"),o(167,"Weight Unit"),n(),i(168,"mat-select",38),E(169,Ut,2,2,"mat-option",22,P),n()()()(),i(171,"div",8)(172,"h3",9),o(173," Status "),n(),i(174,"div",15)(175,"mat-checkbox",39),o(176," Product is active and available for purchase "),n()()()()(),i(177,"mat-dialog-actions",40)(178,"button",41),h("click",function(){return s(l),p(t.onCancel())}),o(179,"Cancel"),n(),i(180,"button",42),h("click",function(){return s(l),p(t.onSubmit())}),i(181,"mat-icon"),o(182),n(),o(183),n()()}if(r&2){let l=be(93);d(3),f(t.isEditMode?"edit":"add_circle"),d(2),f(t.isEditMode?"Edit Product":"Add New Product"),d(4),u("formGroup",t.productForm),d(12),f(t.getErrorMessage("name")),d(8),f(t.getErrorMessage("sku")),d(9),f(t.getErrorMessage("description")),d(15),f(t.getErrorMessage("imageUrl")),d(9),I(t.categories),d(5),f(t.getErrorMessage("category")),d(7
1),I(t.brands),d(10),I(t.vendors),d(10),I(t.tags),d(2),u("matChipInputFor",l)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),d(16),f(t.getErrorMessage("cost")),d(8),f(t.getErrorMessage("basePrice")),d(8),f(t.getErrorMessage("tax")),d(8),f(t.getErrorMessage("price")),d(12),f(t.getErrorMessage("stock")),d(8),f(t.getErrorMessage("reserved")),d(8),f(t.getErrorMessage("weight")),d(5),I(t.weightUnits),d(11),u("disabled",t.productForm.invalid),d(2),f(t.isEditMode?"save":"add"),d(),y(" ",t.isEditMode?"Update Product":"Create Product"," ")}},dependencies:[B,Be,De,$,U,N,Ve,Re,Oe,z,A,Ae,je,qe,He,H,j,Y,X,G,Ge,Q,J,ie,te,re,oe,ne,K,q,ee,Z,le,at,lt,ae,ot,vt],styles:[".mat-mdc-dialog-container .mdc-dialog__surface{border-radius:8px}  .custom-form-field .mat-form-field-appearance-outline .mat-form-field-prefix,   .custom-form-field .mat-form-field-appearance-outline .mat-form-field-suffix{place-self:center}mat-dialog-content[_ngcontent-%COMP%]{max-height:70vh;overflow-y:auto}.form-section[_ngcontent-%COMP%]{padding:16px;background:#f9f9f9;border-radius:8px;margin-bottom:16px}.form-section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-row[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]{width:100%}mat-chip-grid[_ngcontent-%COMP%]{min-height:40px}@media(max-width:768px){.form-row[_ngcontent-%COMP%]{grid-template-columns:1fr!important}}"]})}return a})();var zt=a=>({width:a}),At=()=>["expandedDetail"];function jt(a,m){a&1&&g(0,"page-header",1),a&2&&u("hideBanner",!0)}function Ht(a,m){a&1&&(i(0,"th",32),o(1,"Image"),n())}function qt(a,m){if(a&1&&g(0,"img",35),a&2){let e=c().$implicit;u("src",e.imageUrl,ue)("alt",e.name)}}function Kt(a,m){a&1&&(i(0,"span",36),o(1,"NO"),g(2,"br"),o(3,"THUMB"),n())}function Gt(a,m){if(a&1){let e=w();i(0,"td",33),h("click",function(){let t=s(e).$implicit,l=c();return p(l.toggleRow(t))}),i(1,"div",6)(2,"div",34),T(3,qt,1,2,"img",35),T(4,Kt,4,0,"span",36),n()()()}if(a&2){let e=m.$implicit;d(3),L(e.imageUrl?3:-1),d(),L(e.imageUrl?-1:4)}}function Qt(a,m){a&1&&(i(0,"th",37),o(1,"SKU"),n())}function Jt(a,m){if(a&1){let e=w();i(0,"td",33),h("click",function(){let t=s(e).$implicit,l=c();return p(l.toggleRow(t))}),i(1,"span",38),o(2),n()()}if(a&2){let e=m.$implicit;d(2),f(e.sku)}}function Xt(a,m){a&1&&(i(0,"th",37),o(1,"Name"),n())}function Yt(a,m){if(a&1){let e=w();i(0,"td",33),h("click",function(){let t=s(e).$implicit,l=c();return p(l.toggleRow(t))}),i(1,"div")(2,"div",38),o(3),n()()()}if(a&2){let e=m.$implicit;d(3),f(e.name)}}function Zt(a,m){a&1&&(i(0,"th",37),o(1,"Price"),n())}function ei(a,m){if(a&1){let e=w();i(0,"td",33),h("click",function(){let t=s(e).$implicit,l=c();return p(l.toggleRow(t))}),i(1,"span",39),o(2),Ie(3,"number"),n()()}if(a&2){let e=m.$implicit;d(2),y("$",ke(3,1,e.price,"1.2-2"))}}function ti(a,m){a&1&&(i(0,"th",37),o(1,"Stock"),n())}function ii(a,m){a&1&&(i(0,"mat-icon",40),o(1,"warning"),n())}function ni(a,m){if(a&1){let e=w();i(0,"td",33),h("click",function(){let t=s(e).$implicit,l=c();return p(l.toggleRow(t))}),i(1,"span",39),o(2),T(3,ii,2,0,"mat-icon",40),n()()}if(a&2){let e=m.$implicit;d(),we("color",e.stock<10?"#f44336":"#4caf50"),d(),y(" ",e.stock," "),d(),L(e.stock<10?3:-1)}}function oi(a,m){a&1&&(i(0,"th",41),o(1,"Active"),n())}function ri(a,m){a&1&&(i(0,"mat-icon",43),o(1,"check_circle"),n())}function ai(a,m){a&1&&(i(0,"mat-icon",44),o(1,"cancel"),n())}function li(a,m){if(a&1){let e=w();i(0,"td",42),h("click",function(t){return s(e),p(t.stopPropagation())}),T(1,ri,2,0,"mat-icon",43),T(2,ai,2,0,"mat-icon",44),n()}if(a&2){let e=m.$implicit;d(),L(e.active?1:-1),d(),L(e.active?-1:2)}}function di(a,m){a&1&&(i(0,"th",32),o(1,"Details"),n())}function mi(a,m){if(a&1){let e=w();i(0,"td",45),h("click",function(){let t=s(e).$implicit,l=c();return p(l.toggleRow(t))}),i(1,"button",46)(2,"mat-icon"),o(3),n()()()}if(a&2){let e=m.$implicit,r=c();d(3),f(r.expandedProduct===e?"expand_less":"expand_more")}}function ci(a,m){if(a&1&&g(0,"img",35),a&2){let e=c(2).$implicit;u("src",e.imageUrl,ue)("alt",e.name)}}function si(a,m){a&1&&(i(0,"mat-icon",53),o(1,"image"),n())}function pi(a,m){if(a&1&&(i(0,"mat-option",62),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),f(e)}}function ui(a,m){if(a&1&&(i(0,"mat-option",62),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),f(e)}}function gi(a,m){if(a&1&&(i(0,"mat-option",62),o(1),n()),a&2){let e=m.$implicit;u("value",e),d(),f(e)}}function fi(a,m){if(a&1){let e=w();i(0,"mat-chip",76),h("removed",function(){let t=s(e).$implicit,l=c(2).$implicit,x=c();return p(x.removeTag(l,t))}),o(1),i(2,"mat-icon",77),o(3,"cancel"),n()()}if(a&2){let e=m.$implicit;u("removable",!0),d(),y(" ",e," ")}}function _i(a,m){if(a&1){let e=w();i(0,"div",49)(1,"div",50)(2,"div",51)(3,"div",52),T(4,ci,1,2,"img",35),T(5,si,2,0,"mat-icon",53),n(),i(6,"button",54),o(7,"Change Image"),n()(),i(8,"div",55)(9,"mat-form-field",56)(10,"mat-label"),o(11,"Name"),n(),i(12,"input",57),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.name,t)||(l.name=t),p(t)}),n()(),i(13,"mat-form-field",56)(14,"mat-label"),o(15,"Cost"),n(),i(16,"input",58),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.cost,t)||(l.cost=t),p(t)}),n(),i(17,"span",59),o(18,"$\xA0"),n(),i(19,"span",60),o(20,".00"),n()(),i(21,"mat-form-field",56)(22,"mat-label"),o(23,"Weight"),n(),i(24,"input",58),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.weight,t)||(l.weight=t),p(t)}),n(),i(25,"span",60),o(26),n()(),i(27,"mat-form-field",56)(28,"mat-label"),o(29,"SKU"),n(),i(30,"input",57),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.sku,t)||(l.sku=t),p(t)}),n()(),i(31,"mat-form-field",56)(32,"mat-label"),o(33,"Barcode"),n(),i(34,"input",57),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.barcode,t)||(l.barcode=t),p(t)}),n()(),i(35,"mat-form-field",56)(36,"mat-label"),o(37,"Base Price"),n(),i(38,"input",58),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.basePrice,t)||(l.basePrice=t),p(t)}),n(),i(39,"span",59),o(40,"$\xA0"),n(),i(41,"span",60),o(42,".00"),n()(),i(43,"mat-form-field",56)(44,"mat-label"),o(45,"Category"),n(),i(46,"mat-select",61),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.category,t)||(l.category=t),p(t)}),E(47,pi,2,2,"mat-option",62,P),n()(),i(49,"mat-form-field",56)(50,"mat-label"),o(51,"Brand"),n(),i(52,"mat-select",61),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.brand,t)||(l.brand=t),p(t)}),E(53,ui,2,2,"mat-option",62,P),n()(),i(55,"mat-form-field",56)(56,"mat-label"),o(57,"Vendor"),n(),i(58,"mat-select",61),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.vendor,t)||(l.vendor=t),p(t)}),E(59,gi,2,2,"mat-option",62,P),n()(),i(61,"mat-form-field",56)(62,"mat-label"),o(63,"Tax"),n(),g(64,"input",63),i(65,"span",60),o(66,"\xA0%"),n()(),i(67,"div",64)(68,"div",65)(69,"mat-icon",44),o(70,"disabled_visible"),n(),i(71,"span",39),o(72,"Product status:"),n(),i(73,"mat-checkbox",66),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.active,t)||(l.active=t),p(t)}),o(74),n()()(),i(75,"mat-form-field",56)(76,"mat-label"),o(77,"Stock"),n(),i(78,"input",58),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.stock,t)||(l.stock=t),p(t)}),n()(),i(79,"mat-form-field",56)(80,"mat-label"),o(81,"Reserved"),n(),i(82,"input",58),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.reserved,t)||(l.reserved=t),p(t)}),n()(),i(83,"mat-form-field",56)(84,"mat-label"),o(85,"Price"),n(),i(86,"input",58),S("ngModelChange",function(t){s(e);let l=c().$implicit;return v(l.price,t)||(l.price=t),p(t)}),n(),i(87,"span",59),o(88,"$\xA0"),n(),i(89,"span",60),o(90,".00"),n()(),i(91,"div",67)(92,"mat-form-field",68)(93,"mat-label"),o(94,"Tags"),n(),g(95,"input",69),i(96,"button",70)(97,"mat-icon"),o(98,"add_circle"),n()()(),i(99,"mat-chip-listbox",71),E(100,fi,4,2,"mat-chip",72,P),n()()()(),i(102,"div",73)(103,"button",74),h("click",function(){s(e);let t=c().$implicit,l=c();return p(l.deleteProduct(t))}),o(104," Delete "),n(),i(105,"button",75),h("click",function(){s(e);let t=c().$implicit,l=c();return p(l.updateProduct(t))}),o(106," Update "),n()()()}if(a&2){let e=c().$implicit,r=c();d(4),L(e.imageUrl?4:-1),d(),L(e.imageUrl?-1:5),d(7),C("ngModel",e.name),d(4),C("ngModel",e.cost),d(8),C("ngModel",e.weight),d(2),y("\xA0",e.weightUnit||"lbs"),d(4),C("ngModel",e.sku),d(4),C("ngModel",e.barcode),d(4),C("ngModel",e.basePrice),d(8),C("ngModel",e.category),d(),I(r.categories),d(5),C("ngModel",e.brand),d(),I(r.brands),d(5),
1C("ngModel",e.vendor),d(),I(r.vendors),d(14),C("ngModel",e.active),d(),y(" ",e.active?"Active":"Disabled"," "),d(4),C("ngModel",e.stock),d(4),C("ngModel",e.reserved),d(4),C("ngModel",e.price),d(14),I(e.tags)}}function hi(a,m){if(a&1&&(i(0,"td",47)(1,"div",48),T(2,_i,107,17,"div",49),n()()),a&2){let e=m.$implicit,r=c();xe("colspan",r.displayedColumns.length),d(),u("@detailExpand",e==r.expandedProduct?"expanded":"collapsed"),d(),L(r.expandedProduct===e?2:-1)}}function xi(a,m){a&1&&g(0,"tr",78)}function Ci(a,m){if(a&1&&g(0,"tr",79),a&2){let e=m.$implicit,r=c();ye("expanded-row",r.expandedProduct===e)}}function vi(a,m){a&1&&g(0,"tr",80)}var hn=(()=>{class a{productService;dialog;notify;ngxLoader;fuseConfigService;breakpointObserver;ecommerceContextService;sort;eventID;hideHeader=!1;products=[];filteredProducts=[];paginatedProducts=[];displayedColumns=["image","sku","name","price","stock","active","details"];expandedProduct=null;searchTerm="";selectedCategory="";categories=[];brands=[];vendors=[];Math=Math;pageSize=10;pageIndex=0;totalProducts=0;pageSizeOptions=[10,25,50,100];fuseConfig;isMobile=!1;destroy$=new he;constructor(e,r,t,l,x,se,Mt){this.productService=e,this.dialog=r,this.notify=t,this.ngxLoader=l,this.fuseConfigService=x,this.breakpointObserver=se,this.ecommerceContextService=Mt,this.fuseConfigService.config.pipe(M(this.destroy$)).subscribe(pe=>{this.fuseConfig=pe}),this.breakpointObserver.observe(["(max-width: 599px)"]).pipe(M(this.destroy$)).subscribe(pe=>{this.isMobile=!!pe.matches})}ngOnInit(){this.eventID&&this.ecommerceContextService.setEventID(this.eventID),this.loadProducts(),this.loadCategories(),this.loadBrands(),this.loadVendors()}ngOnDestroy(){this.eventID&&this.ecommerceContextService.setEventID(void 0),this.destroy$.next(),this.destroy$.complete()}loadProducts(){this.ngxLoader.start(),this.productService.getProducts().pipe(M(this.destroy$)).subscribe({next:e=>{this.products=e,this.applyFilters(),this.ngxLoader.stop()},error:e=>{this.notify.openAlertModal(e.error?e.error:"Failed to load products",D.ERROR),console.error(e),this.ngxLoader.stop()}})}loadCategories(){this.productService.getCategories().pipe(M(this.destroy$)).subscribe({next:e=>{this.categories=e},error:e=>{this.notify.openAlertModal(e.error?e.error:"Failed to load categories",D.ERROR),console.error(e)}})}applyFilters(){let e=[...this.products];if(this.searchTerm){let r=this.searchTerm.toLowerCase();e=e.filter(t=>t.name.toLowerCase().includes(r)||t.sku.toLowerCase().includes(r)||t.description?.toLowerCase().includes(r))}this.selectedCategory&&(e=e.filter(r=>r.category===this.selectedCategory)),this.filteredProducts=e,this.totalProducts=e.length,this.updatePaginatedProducts()}updatePaginatedProducts(){let e=this.pageIndex*this.pageSize,r=e+this.pageSize;this.paginatedProducts=this.filteredProducts.slice(e,r)}onPageChange(e){this.pageSize=e.pageSize,this.pageIndex=e.pageIndex,this.updatePaginatedProducts()}onPageSizeChange(){this.pageIndex=0,this.updatePaginatedProducts()}onSearch(){this.pageIndex=0,this.applyFilters()}onCategoryChange(){this.pageIndex=0,this.applyFilters()}clearFilters(){this.searchTerm="",this.selectedCategory="",this.pageIndex=0,this.applyFilters()}addProduct(){this.dialog.open(_e,{width:"900px",maxHeight:"90vh",data:{product:null,mode:"create"}}).afterClosed().subscribe(r=>{r&&(this.ngxLoader.start(),this.productService.createProduct(r).pipe(M(this.destroy$)).subscribe({next:()=>{this.notify.openToaster("Product created successfully","success"),this.loadProducts()},error:t=>{this.notify.openAlertModal(t.error?t.error:"Failed to create product",D.ERROR),console.error(t),this.ngxLoader.stop()}}))})}editProduct(e){this.dialog.open(_e,{width:"900px",maxHeight:"90vh",data:{product:R({},e),mode:"edit"}}).afterClosed().subscribe(t=>{t&&e.id&&(this.ngxLoader.start(),this.productService.updateProduct(e.id,t).pipe(M(this.destroy$)).subscribe({next:()=>{this.notify.openToaster("Product updated successfully","success"),this.loadProducts()},error:l=>{this.notify.openAlertModal(l.error?l.error:"Failed to update product",D.ERROR),console.error(l),this.ngxLoader.stop()}}))})}deleteProduct(e){confirm(`Are you sure you want to delete "${e.name}"?`)&&e.id&&(this.ngxLoader.start(),this.productService.deleteProduct(e.id).pipe(M(this.destroy$)).subscribe({next:()=>{this.notify.openToaster("Product deleted successfully","success"),this.loadProducts()},error:r=>{this.notify.openAlertModal(r.error?r.error:"Failed to delete product",D.ERROR),console.error(r),this.ngxLoader.stop()}}))}toggleActive(e,r){if(e.id){let t=O(R({},e),{active:r.checked});this.ngxLoader.start(),this.productService.updateProduct(e.id,t).pi
1pe(M(this.destroy$)).subscribe({next:()=>{this.notify.openToaster(`Product ${t.active?"activated":"deactivated"}`,"success"),this.loadProducts()},error:l=>{this.notify.openAlertModal(l.error?l.error:"Failed to update product status",D.ERROR),console.error(l),this.ngxLoader.stop()}})}}getStockColor(e,r){let t=e-r;return t<=0?"warn":t<10?"accent":"primary"}getStockIcon(e,r){let t=e-r;return t<=0?"error":t<10?"warning":"check_circle"}loadBrands(){this.productService.getBrands().pipe(M(this.destroy$)).subscribe({next:e=>{this.brands=e},error:e=>{console.error("Failed to load brands:",e)}})}loadVendors(){this.productService.getVendors().pipe(M(this.destroy$)).subscribe({next:e=>{this.vendors=e},error:e=>{console.error("Failed to load vendors:",e)}})}toggleRow(e){this.expandedProduct=this.expandedProduct===e?null:e}removeTag(e,r){e.tags&&(e.tags=e.tags.filter(t=>t!==r))}updateProduct(e){e.id&&(this.ngxLoader.start(),this.productService.updateProduct(e.id,e).pipe(M(this.destroy$)).subscribe({next:()=>{this.notify.openToaster("Product updated successfully","success"),this.expandedProduct=null,this.loadProducts()},error:r=>{this.notify.openAlertModal(r.error?r.error:"Failed to update product",D.ERROR),console.error(r),this.ngxLoader.stop()}}))}sortData(e){let r=this.filteredProducts.slice();if(!e.active||e.direction===""){this.filteredProducts=r,this.updatePaginatedProducts();return}this.filteredProducts=r.sort((t,l)=>{let x=e.direction==="asc";switch(e.active){case"sku":return this.compare(t.sku,l.sku,x);case"name":return this.compare(t.name,l.name,x);case"price":return this.compare(t.price,l.price,x);case"stock":return this.compare(t.stock,l.stock,x);default:return 0}}),this.updatePaginatedProducts()}compare(e,r,t){return(e<r?-1:1)*(t?1:-1)}static \u0275fac=function(r){return new(r||a)(b(ce),b(ze),b(tt),b(Qe),b(Xe),b($e),b(me))};static \u0275cmp=W({type:a,selectors:[["app-product-list"]],viewQuery:function(r,t){if(r&1&&Ce(de,5),r&2){let l;ve(l=Se())&&(t.sort=l.first)}},inputs:{eventID:"eventID",hideHeader:"hideHeader"},features:[Me([me])],decls:48,vars:14,consts:[["id","inventory",1,"page-layout","simple","fullwidth"],["title","Inventory","subtitle","Manage your product catalog","matIcon","inventory",3,"hideBanner"],[1,"content","p-24",3,"ngStyle"],[1,"inventory-container","mat-elevation-z2",2,"background","white","border-radius","12px","overflow","hidden"],[1,"inventory-header",2,"padding","20px 24px","border-bottom","1px solid #e0e0e0","display","flex","align-items","center","gap","16px","justify-content","space-between","flex-wrap","wrap"],[2,"margin","0","font-size","24px","font-weight","500"],[2,"display","flex","align-items","center","gap","12px"],["appearance","outline","subscriptSizing","dynamic",2,"width","300px"],["matInput","","placeholder","Search by name, SKU...",3,"ngModelChange","keyup","ngModel"],["matPrefix",""],["mat-raised-button","","color","primary",2,"height","48px",3,"click"],[1,"table-wrapper"],["mat-table","","matSort","","multiTemplateDataRows","",1,"products-table",2,"width","100%",3,"matSortChange","dataSource"],["matColumnDef","image"],["mat-header-cell","","style","width: 80px;",4,"matHeaderCellDef"],["mat-cell","","style","cursor: pointer;",3,"click",4,"matCellDef"],["matColumnDef","sku"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","name"],["matColumnDef","price"],["matColumnDef","stock"],["matColumnDef","active"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",3,"click",4,"matCellDef"],["matColumnDef","details"],["mat-cell","","style","cursor: pointer; text-align: center;",3,"click",4,"matCellDef"],["matColumnDef","expandedDetail"],["mat-cell","",4,"matCellDef"],["mat-header-row","","style","background: #fafafa;",4,"matHeaderRowDef"],["mat-row","","class","product-row","style","border-bottom: 1px solid #e0e0e0;",3,"expanded-row",4,"matRowDef","matRowDefColumns"],["mat-row","","class","detail-row",4,"matRowDef","matRowDefColumns"],[2,"background","transparent",3,"page","length","pageSize","pageIndex","pageSizeOptions"],["mat-header-cell","",2,"width","80px"],["mat-cell","",2,"cursor","pointer",3,"click"],[1,"product-thumb",2,"width","45px","height","45px","border-radius","6px","overflow","hidden","background","#f5f5f5","display","flex","align-items","center","justify-content","center","flex-shrink","0"],[2,"width","100%","height","100%","object-fit","cover",3,"src","alt"],[2,"font-size","10px","color","#999","text-align","center"],["mat-header-cell","","mat-sort-header",""],[2,"font-weight","500","color","#1a1a1a"],[2,"font-weight","500"],[2,"font-size","16px","width","16px","height","16px","vertical-align","middle","color","#f44336"],["mat-header-cell",""],["mat-cell","",3,"click"],[2,"color","#4caf50"],[2,"color","#999"],["mat-cell","",2,"cursor","pointer","text-align","center",3,"click"],["mat-icon-button",""],["mat-cell",""],[1,"product-detail"],[2,"padding","24px","background","#fafafa"],[2,"display","flex","gap","24px","align-items","flex-start"],[2,"width","200px","flex-shrink","0"],[2,"width","180px","height","180px","border-radius","8px","overflow","hidden","background","#fff","border","2px solid #e0e0e0","display","flex","align-items","center","justify-content","center"],[2,"font-size","64px","width","64px","height","64px","color","#ccc"],["mat-button","","color","primary",2,"margin-top","8px","width","100%"],[2,"flex","1","display","grid","grid-template-columns","repeat(auto-fit, minmax(250px, 1fr))","gap","16px"],["appearance","outline","subscriptSizing","dynamic"],["matInput","",3,"ngModelChange","ngModel"],["matInput","","type","number",3,"ngModelChange","ngModel"],["matTextPrefix",""],["matTextSuffix",""],[3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","number","value","20"],[2,"grid-column","1 / -1","margin-top","8px"],[2,"display","flex","align-items","center","gap","16px"],["color","primary",3,"ngModelChange","ngModel"],[2,"grid-column","1 / -1"],["appearance","outline","subscriptSizing","dynamic",2,"width","100%"],["matInput","","placeholder","Enter tag name"],["mat-icon-button","","matTextSuffix",""],[2,"margin-top","8px"],[3,"removable"],[2,"display","flex","justify-content","space-between","margin-top","24px","padding-top","16px","border-top","1px solid #e0e0e0"],["mat-button","","color","warn",3,"click"],["mat-raised-button","","color","primary",3,"click"],[3,"removed","removable"],["matChipRemove",""],["mat-header-row","",2,"background","#fafafa"],["mat-row","",1,"product-row",2,"border-bottom","1px solid #e0e0e0"],["mat-row","",1,"detail-row"]],template:function(r,t){r&1&&(i(0,"div",0),T(1,jt,1,1,"page-header",1),i(2,"div",2)(3,"div",3)(4,"div",4)(5,"h2",5),o(6,"Inventory"),n(),i(7,"div",6)(8,"mat-form-field",7)(9,"mat-label"),o(10,"Search products"),n(),i(11,"input",8),S("ngModelChange",function(x){return v(t.searchTerm,x)||(t.searchTerm=x),x}),h("keyup",function(){return t.onSearch()}),n(),i(12,"mat-icon",9),o(13,"search"),n()(),i(14,"button",10),h("click",function(){return t.addProduct()}),i(15,"mat-icon"),o(16,"add"),n(),o(17," Add "),n()()(),i(18,"div",11)(19,"table",12),h("matSortChange",function(x){return t.sortData(x)}),V(20,13),k(21,Ht,2,0,"th",14)(22,Gt,5,2,"td",15),F(),V(23,16),k(24,Qt,2,0,"th",17)(25,Jt,3,1,"td",15),F(),V(26,18),k(27,Xt,2,0,"th",17)(28,Yt,4,1,"td",15),F(),V(29,19),k(30,Zt,2,0,"th",17)(31,ei,4,4,"td",15),F(),V(32,20),k(33,ti,2,0,"th",17)(34,ni,4,4,"td",15),F(),V(35,21),k(36,oi,2,0,"th",22)(37,li,3,2,"td",23),F(),V(38,24),k(39,di,2,0,"th",14)(40,mi,4,1,"td",25),F(),V(41,26),k(42,hi,3,3,"td",27),F(),k(43,xi,1,0,"tr",28)(44,Ci,1,2,"tr",29)(45,vi,1,0,"tr",30),n()(),i(46,"div")(47,"mat-paginator",31),h("page",function(x){return t.onPageChange(x)}),n()()()()()),r&2&&(d(),L(t.hideHeader?-1:1),d(),u("ngStyle",Ee(11,zt,t.fuseConfig.pageWidth&&!t.isMobile?t.fuseConfig.pageWidth+"%":"
1100%")),d(9),C("ngModel",t.searchTerm),d(8),u("dataSource",t.paginatedProducts),d(24),u("matHeaderRowDef",t.displayedColumns),d(),u("matRowDefColumns",t.displayedColumns),d(),u("matRowDefColumns",Pe(13,At)),d(2),u("length",t.totalProducts)("pageSize",t.pageSize)("pageIndex",t.pageIndex)("pageSizeOptions",t.pageSizeOptions))},dependencies:[B,Te,z,$,U,N,Fe,H,j,Ke,ee,Z,ie,te,X,G,Q,J,Y,Ct,mt,st,ft,pt,ct,_t,ut,gt,ht,xt,K,q,re,oe,ne,le,nt,rt,ae,A,it,bt,St,yt,de,wt,dt,Je,Le],styles:[".product-list-container[_ngcontent-%COMP%]{max-width:1400px;margin:0 auto}.toolbar[_ngcontent-%COMP%]{background:#fff;padding:16px;border-radius:8px;box-shadow:0 2px 4px #0000001a}.products-table[_ngcontent-%COMP%]   .mat-mdc-row[_ngcontent-%COMP%]{transition:background-color .2s}.products-table[_ngcontent-%COMP%]   .mat-mdc-row[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.products-table[_ngcontent-%COMP%]   .mat-mdc-header-cell[_ngcontent-%COMP%]{font-weight:600;color:#333}.products-table[_ngcontent-%COMP%]   .mat-mdc-header-cell.mat-sort-header[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none}.products-table[_ngcontent-%COMP%]   .mat-mdc-header-cell.mat-sort-header[_ngcontent-%COMP%]:hover{color:#1976d2}.products-table[_ngcontent-%COMP%]   .mat-mdc-cell[_ngcontent-%COMP%]{padding:16px 8px}  tr.detail-row{height:0!important;overflow:hidden}  tr.mat-mdc-row.detail-row{height:0!important;overflow:hidden}  tr.mat-mdc-row.detail-row td{border-bottom-width:0!important;padding:0!important}  .product-row{cursor:pointer}  .product-row.expanded-row{background-color:#f5f5f5;border-bottom:1px solid transparent}  .product-row:not(.expanded-row)+.detail-row{display:none}.product-detail[_ngcontent-%COMP%]{overflow:hidden}.product-image[_ngcontent-%COMP%]{border:1px solid #e0e0e0}mat-chip[_ngcontent-%COMP%]{font-size:12px;min-height:24px}mat-paginator[_ngcontent-%COMP%]{border-top:1px solid #e0e0e0}@media(max-width:768px){.toolbar[_ngcontent-%COMP%]{flex-direction:column}.toolbar[_ngcontent-%COMP%]   mat-form-field[_ngcontent-%COMP%]{width:100%!important}.toolbar[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{width:100%}.products-table[_ngcontent-%COMP%]   .mat-mdc-cell[_ngcontent-%COMP%]{font-size:12px;padding:8px 4px}}"],data:{animation:[Ye("detailExpand",[fe("collapsed",ge({height:"0px",minHeight:"0",overflow:"hidden"})),fe("expanded",ge({height:"*"})),et("expanded <=> collapsed",Ze("300ms cubic-bezier(0.4, 0.0, 0.2, 1)"))])]}})}return a})();export{hn as ProductListComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.