dealposbarcode 26.46.0 → 26.46.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{a as ea,c as ra,i as _i,l as vi,n as Mt,o as ha,s as hl,t as Ai$1}from"./chunk-gHwe0hNr.js";import{l as xt,p as U,s as Wt}from"./main-5ONFLEQS.js";import{c as Sn,d as gn,g as ye,l as Ti,m as mn,p as jn,s as Ri,u as Wn}from"./chunk-DVmYwAhe.js";import{$ as gl,At as ze,Dt as yi,Et as wl,G as bl,H as _t,I as Wl,J as dl,L as Xi,Mt as zr,O as Su,Q as gd,Tt as wc,X as fe,Z as fl,_ as Hl,at as ks,b as Kr,bt as ul,c as Bl,d as Do$1,dt as qa$1,et as hd,f as El,ft as qu,g as Fs,h as Fo$1,jt as zl,kt as z,lt as nl,mt as rp,n as Aa,p as Eo$1,q as ct,r as Ac$1,s as At,st as md,t as $,ut as ol,vt as tu,w as Ol,wt as vu,z as Ze}from"./chunk-CZtkF-WL.js";import{K as oh,R as hh,U as le,Y as sc,it as xe,k as _l,o as Go$1,ot as xs}from"./chunk-CtdBLXrI.js";import{$ as Jw,$n as hb,B as GI,Ci as zu,Dr as ml,E,Er as mi,Fn as ee,Fr as od,Ft as Rh,H as Gu,Hn as fl$1,Jn as gi$1,Kn as fw,Lr as ov,Lt as Sb,Ot as QI,Pn as eb,Qn as gw,S as Db,Sr as lg,St as Pi,Ti as G,Tn as cg,Ut as Tg,V as Gh,Vn as fg,Vt as Tb,W as Hb,Wt as Th,X as Jh,Yn as gl$1,Yt as U1,_r as kh,_t as Ow,ai as ue,ar as hw,bi as zh,br as kw,bt as Pb,c as Ah,di as vw,ei as ti,en as Vw,er as hd$1,fr as jw,ft as O1,g as Br,gi as x,gn as _h,hn as _b,ht as Oh,ii as ub,it as Mb,j as F1,jr as mw,kn as dg,lt as Nb,m as Bh,nn as W1,on as Xi$1,or as iI,pr as k1,qn as gb,qt as Tw,tr as hg,tt as L1,u as Aw,ur as jD,vi as yw,vn as bb,vt as P1,w as Du,wi as F,wr as mb,xr as le$1,xt as Ph,yr as ko$1,yt as PD,z as GD}from"./chunk-LD3k3Loy.js";var $a=`
1
+ import{a as ea,c as ra,i as _i,l as vi,n as Mt,o as ha,s as hl,t as Ai$1}from"./chunk-BTkPXAJR.js";import{l as xt,p as U,s as Wt}from"./main-Q45KL3O3.js";import{c as Sn,d as gn,g as ye,l as Ti,m as mn,p as jn,s as Ri,u as Wn}from"./chunk-DVmYwAhe.js";import{$ as gl,At as ze,Dt as yi,Et as wl,G as bl,H as _t,I as Wl,J as dl,L as Xi,Mt as zr,O as Su,Q as gd,Tt as wc,X as fe,Z as fl,_ as Hl,at as ks,b as Kr,bt as ul,c as Bl,d as Do$1,dt as qa$1,et as hd,f as El,ft as qu,g as Fs,h as Fo$1,jt as zl,kt as z,lt as nl,mt as rp,n as Aa,p as Eo$1,q as ct,r as Ac$1,s as At,st as md,t as $,ut as ol,vt as tu,w as Ol,wt as vu,z as Ze}from"./chunk-CZtkF-WL.js";import{K as oh,R as hh,U as le,Y as sc,it as xe,k as _l,o as Go$1,ot as xs}from"./chunk-CtdBLXrI.js";import{$ as Jw,$n as hb,B as GI,Ci as zu,Dr as ml,E,Er as mi,Fn as ee,Fr as od,Ft as Rh,H as Gu,Hn as fl$1,Jn as gi$1,Kn as fw,Lr as ov,Lt as Sb,Ot as QI,Pn as eb,Qn as gw,S as Db,Sr as lg,St as Pi,Ti as G,Tn as cg,Ut as Tg,V as Gh,Vn as fg,Vt as Tb,W as Hb,Wt as Th,X as Jh,Yn as gl$1,Yt as U1,_r as kh,_t as Ow,ai as ue,ar as hw,bi as zh,br as kw,bt as Pb,c as Ah,di as vw,ei as ti,en as Vw,er as hd$1,fr as jw,ft as O1,g as Br,gi as x,gn as _h,hn as _b,ht as Oh,ii as ub,it as Mb,j as F1,jr as mw,kn as dg,lt as Nb,m as Bh,nn as W1,on as Xi$1,or as iI,pr as k1,qn as gb,qt as Tw,tr as hg,tt as L1,u as Aw,ur as jD,vi as yw,vn as bb,vt as P1,w as Du,wi as F,wr as mb,xr as le$1,xt as Ph,yr as ko$1,yt as PD,z as GD}from"./chunk-LD3k3Loy.js";var $a=`
2
2
  .p-datatable {
3
3
  position: relative;
4
4
  display: block;
@@ -1 +1 @@
1
- import{_ as W,b as Z,f as T,p as U,x as eu,y as Ya}from"./main-5ONFLEQS.js";import{i as ur,n as dr,r as mr,t as Ac}from"./chunk-D5ZHYKIN.js";import{t as Ai}from"./chunk-gHwe0hNr.js";import{t as h}from"./chunk-CyE7pq6Z.js";import{f as gr,h as qr,n as An,r as Ee}from"./chunk-DVmYwAhe.js";import"./chunk-CZtkF-WL.js";import"./chunk-DAfeU1o0.js";import{F as fh,K as oh,P as dh,S as Tl,W as lh,X as sh,tt as vl}from"./chunk-CtdBLXrI.js";import{$ as Jw,$n as hb,B as GI,Ci as zu,E,Ft as Rh,G as He,Gn as fs,H as Gu,Hn as fl,Kn as fw,Ot as QI,Qr as sm,St as Pi,Ti as G,Tn as cg,Vn as fg,W as Hb,Xr as rm,ar as hw,bt as Pb,ei as ti,er as hd,fi as wb,gn as _h,ht as Oh,ii as ub,kn as dg,m as Bh,oi as ug,or as iI,qr as ql,qt as Tw,sr as im,u as Aw,wi as F,yn as be$1,yt as PD}from"./chunk-LD3k3Loy.js";var ge=()=>({width:`25rem`});var he=()=>({"min-width":`50rem`});function fe(n,u){if(n&1){let e=Tw();Pi(0,`p-button`,19),Bh(`onClick`,function(){Gu(e);let i=Aw(2);return zu(i.onDeleteUser())}),fl()}}function be(n,u){if(n&1){let e=Tw();Pi(0,`p-button`,20),Bh(`onClick`,function(){Gu(e);let i=Aw(2);return zu(i.openAddUser())}),fl()}}function Ce(n,u){if(n&1&&(Pi(0,`div`,16),fw(1,fe,1,0,`p-button`,17),fw(2,be,1,0,`p-button`,18),fl()),n&2){let e=Aw();iI(),hw(e.userChecked()&&e.userChecked().length>0?1:-1),iI(),hw(e.isUserAdmin?2:-1)}}function Ue(n,u){n&1&&(Pi(0,`th`,23),Oh(1,`p-table-header-checkbox`),fl())}function ye(n,u){if(n&1&&(Pi(0,`tr`),fw(1,Ue,2,0,`th`,23),Pi(2,`th`),ub(3,`Login ID`),fl(),Pi(4,`th`),ub(5,`Group`),fl()()),n&2){let e=Aw(3);iI(),hw(e.isUserAdmin?1:-1)}}function ve(n,u){if(n&1&&(Pi(0,`td`),Oh(1,`p-table-checkbox`,25),fl()),n&2){let e=Aw().$implicit;iI(),Rh(`value`,e)}}function Se(n,u){if(n&1){let e=Tw();Pi(0,`tr`),fw(1,ve,2,1,`td`),Pi(2,`td`)(3,`button`,24),Bh(`click`,function(){let i=Gu(e).$implicit,s=Aw(3);return zu(s.openEditUser(i.UserID))}),Pi(4,`span`),ub(5),fl()()(),Pi(6,`td`),ub(7),fl()()}if(n&2){let e=u.$implicit,t=Aw(3);iI(),hw(t.isUserAdmin?1:-1),iI(4),cg(e.Name),iI(2),cg(e.GroupName)}}function xe(n,u){if(n&1&&ub(0),n&2){let e=Aw(3);ug(` Showing `,e.displayStart(),` to `,e.displayEnd(),` of `,e.userCount(),` entries `)}}function we(n,u){if(n&1){let e=Tw();Pi(0,`p-table`,22),Bh(`onPage`,function(i){Gu(e);let s=Aw(2);return zu(s.pageChange(i))})(`onRowUnselect`,function(i){Gu(e);let s=Aw(2);return zu(s.onRowUnselect(i))})(`onRowSelect`,function(i){Gu(e);let s=Aw(2);return zu(s.onRowSelect(i))}),_h(1,ye,6,1,`ng-template`,null,3,Pb)(3,Se,8,3,`ng-template`,null,4,Pb)(5,xe,1,3,`ng-template`,null,5,Pb),fl()}if(n&2){let e=Aw(2);Rh(`lazy`,!0)(`paginator`,!0)(`rows`,e.rowsPerPage())(`first`,e.firstIndex())(`totalRecords`,e.userCount())(`value`,e.userList())(`tableStyle`,wb(7,he))}}function De(n,u){if(n&1&&(Pi(0,`p-panel`),fw(1,we,7,8,`p-table`,21),fl()),n&2){let e=Aw();iI(),hw(e.filter()?1:-1)}}function Fe(n,u){if(n&1){let e=Tw();Pi(0,`form`,8)(1,`div`,9)(2,`label`,10),ub(3,`Group`),fl(),Pi(4,`p-select`,12),GI(),fl()(),Pi(5,`div`,13)(6,`p-button`,14),Bh(`onClick`,function(){Gu(e);let i=Aw();return zu(i.onCloseFilterDialog())}),fl(),Pi(7,`p-button`,26),Bh(`onClick`,function(){Gu(e);let i=Aw();return zu(i.submitFilter())}),fl()()()}if(n&2){let e=Aw();Rh(`formGroup`,e.dialogFilterForm),iI(4),Rh(`options`,e.groupOptions()),QI()}}var Ye=(()=>{class n{constructor(){this.dialogFilterVisible=ti(!1),this.userList=ti([]),this.groupOptions=ti([]),this.userOptions=ti([]),this.userChecked=ti([]),this.dialogVisible=ti(!1),this.dialogMode=ti(null),this.querySearch=ti(``),this.filter=ti(null),this.userCount=ti(0),this.firstIndex=ti(0),this.rowsPerPage=ti(10),this.displayStart=Hb(()=>{let e=this.userCount();return e===0?0:Math.min(this.firstIndex()+1,e)}),this.displayEnd=Hb(()=>Math.min(this.firstIndex()+this.rowsPerPage(),this.userCount())),this.setupUsersService=E(h),this.fb=E(dh),this.route=E(Z),this.router=E(W),this.destroyRef=E(be$1),this.appStore=E(eu),this.initForm(),this.loadUsers(),this.loadOptions(),this.listenRouteState(),hd(()=>{let e=Object.fromEntries(Object.entries(this.filter()??{}).filter(([t,i])=>i!==Ya));this.loadUsers(e)}),T(this.querySearch).pipe(im(300),sm(),U(this.destroyRef)).subscribe(e=>{this.firstIndex.set(0),this.filter.update(t=>t&&G(F({},t),{Name:e?.trim()?e.trim():`00000000-0000-0000-0000-000000000000`,PageNumber:1}))})}get isUserAdmin(){return this.appStore.userRole()===`admin`}initForm(){this.inviteUserForm=this.fb.group({UserID:this.fb.control(null),GroupID:this.fb.control(null)}),this.dialogFilterForm=this.fb.group({GroupID:this.fb.control(null)})}loadUsers(e){this.setupUsersService.getUserList(e).pipe(ql(t=>{this.userList.set(t.Data),this.userCount.set(t.Count)}),fs(t=>(this.userList.set([]),this.userCount.set(0),He)),U(this.destroyRef)).subscribe()}submitFilter(){if(this.dialogFilterForm.invalid){this.dialogFilterForm.markAllAsTouched();return}let e=this.dialogFilterForm.getRawValue();this.filter.update(t=>t&&G(F({},t),{GroupID:e.GroupID||`00000000-0000-0000-0000-000000000000`,PageNumber:1})),this.dialogFilterVisible.set(!1)}pageChange(e){console.log(e),this.firstIndex.set(e.first??0),this.rowsPerPage.set(e.rows??this.rowsPerPage());let t=(e.first??0)/(e.rows??this.rowsPerPage())+1;this.filter.update(i=>i&&G(F({},i),{PageNumber:t}))}loadOptions(){let e=this.route.snapshot.queryParamMap.has(`id`)?{ID:this.route.snapshot.queryParamMap.get(`id`)||``}:{};rm([this.setupUsersService.getUserListLoader1(),this.setupUsersService.getUserListLoader2(e)]).pipe(ql(([t,i])=>{this.filter.update(()=>G(F({},t.Filter),{Name:t.Filter.Name||`00000000-0000-0000-0000-000000000000`,GroupID:t.Filter.GroupID||`00000000-0000-0000-0000-000000000000`})),this.groupOptions.set(t.Options),this.userOptions.set(i.Data);let s=t.Filter.PageSize??this.rowsPerPage(),f=t.Filter.PageNumber??1;this.rowsPerPage.set(s),this.firstIndex.set((f-1)*s)}),U(this.destroyRef)).subscribe()}listenRouteState(){this.route.queryParamMap.pipe(ql(e=>{let t=e.get(`dialog`),i=e.get(`id`);if(t===`create`){this.dialogMode.update(s=>`create`),this.dialogVisible.update(s=>!0);return}if(t===`edit`&&i){this.dialogMode.update(s=>`edit`),this.dialogVisible.update(s=>!0),this.handleUserEdit(i);return}this.dialogVisible.update(s=>!1),this.dialogMode.update(s=>null)})).subscribe()}openAddUser(){this.router.navigate([],{queryParams:{dialog:`create`},queryParamsHandling:`merge`})}openEditUser(e){this.router.navigate([],{queryParams:{dialog:`edit`,id:e},queryParamsHandling:`merge`})}closeModal(){this.router.navigate([],{queryParams:{dialog:null,id:null},queryParamsHandling:`merge`}),this.inviteUserForm.reset(),this.inviteUserForm.controls.UserID.enable({emitEvent:!1})}resetModalState(){this.dialogMode.update(e=>null),this.inviteUserForm.reset()}onSubmit(){if(this.inviteUserForm.invalid){this.inviteUserForm.markAllAsTouched();return}let e=this.inviteUserForm.getRawValue();(this.dialogMode()===`edit`?this.setupUsersService.updateUser(e.UserID,e.GroupID):this.setupUsersService.inviteUser(e)).pipe(ql(()=>{this.loadUsers(),this.closeModal(),this.userChecked.set([]),this.inviteUserForm.reset(),this.inviteUserForm.controls.UserID.enable({emitEvent:!1})}),U(this.destroyRef)).subscribe()}onDeleteUser(){this.setupUsersService.deleteUser(this.userChecked()).pipe(ql(()=>{this.loadUsers(),this.userChecked.set([])}),U(this.destroyRef)).subscribe()}handleUserEdit(e){this.inviteUserForm.reset(),this.setupUsersService.getUserByID(e).pipe(ql(t=>{this.loadOptions(),this.inviteUserForm.controls.UserID.disable({emitEvent:!1}),this.isUserAdmin||this.inviteUserForm.controls.GroupID.disable({emitEvent:!1}),this.inviteUserForm.patchValue({UserID:t.UserID,GroupID:t.GroupID})}),U(this.destroyRef)).subscribe()}onCloseFilterDialog(){this.dialogFilterVisible.set(!1)}onRowSelect(e){let t=e.data.UserID;this.userChecked().includes(t)||this.userChecked.update(i=>[...i,t])}onRowUnselect(e){if(`UserID`in e.data){let t=e.data?.UserID;if(!t)return;this.userChecked.update(i=>i.filter(s=>s!==t))}}static{this.ɵfac=function(t){return new(t||n)}}static{this.ɵcmp=PD({type:n,selectors:[[`app-users`]],decls:20,vars:14,consts:[[`actionButton`,``],[`content`,``],[`filterDialog`,``],[`header`,``],[`body`,``],[`paginatorleft`,``],[`pageTitle`,`Users`,3,`dialogFilterVisibleChange`,`querySearchChange`,`searchable`,`filterable`,`dialogFilterVisible`,`querySearch`],[`appendTo`,`body`,3,`visibleChange`,`onHide`,`header`,`modal`,`visible`],[1,`d-flex`,`flex-column`,`gap-4`,3,`formGroup`],[1,`form-group`,`d-flex`,`flex-column`,`gap-1`],[`for`,``],[`filter`,``,`filterBy`,`LoginID`,`formControlName`,`UserID`,`appendTo`,`body`,`optionLabel`,`LoginID`,`optionValue`,`ID`,`placeholder`,`Select a User`,3,`options`],[`showClear`,``,`filter`,``,`filterBy`,`Name`,`formControlName`,`GroupID`,`appendTo`,`body`,`optionLabel`,`Name`,`optionValue`,`ID`,`placeholder`,`Select a Group`,3,`options`],[1,`d-flex`,`justify-content-end`,`gap-2`],[`label`,`Cancel`,`outlined`,``,`severity`,`secondary`,3,`onClick`],[`severity`,`info`,`label`,`Save`,3,`onClick`,`disabled`],[1,`d-flex`,`gap-2`,`justify-content-end`,`align-items-center`],[`label`,`Delete`],[`severity`,`info`,`label`,`Invite`],[`label`,`Delete`,3,`onClick`],[`severity`,`info`,`label`,`Invite`,3,`onClick`],[`dataKey`,`UserID`,3,`lazy`,`paginator`,`rows`,`first`,`totalRecords`,`value`,`tableStyle`],[`dataKey`,`UserID`,3,`onPage`,`onRowUnselect`,`onRowSelect`,`lazy`,`paginator`,`rows`,`first`,`totalRecords`,`value`,`tableStyle`],[2,`width`,`4rem`],[1,`btn`,`btn-link`,`link-primary`,`link-underline-opacity-0`,3,`click`],[3,`value`],[`severity`,`info`,`label`,`Apply`,3,`onClick`]],template:function(t,i){if(t&1){let s=Tw();Pi(0,`app-main-panel`,6),fg(`dialogFilterVisibleChange`,function(c){return Gu(s),hb(i.dialogFilterVisible,c)||(i.dialogFilterVisible=c),zu(c)})(`querySearchChange`,function(c){return Gu(s),hb(i.querySearch,c)||(i.querySearch=c),zu(c)}),_h(1,Ce,3,2,`ng-template`,null,0,Pb)(3,De,2,1,`ng-template`,null,1,Pb)(5,Fe,8,2,`ng-template`,null,2,Pb),fl(),Pi(7,`p-dialog`,7),fg(`visibleChange`,function(c){return Gu(s),hb(i.dialogVisible,c)||(i.dialogVisible=c),zu(c)}),Bh(`onHide`,function(){return i.closeModal()}),Pi(8,`form`,8)(9,`div`,9)(10,`label`,10),ub(11,`User`),fl(),Pi(12,`p-select`,11),GI(),fl()(),Pi(13,`div`,9)(14,`label`,10),ub(15,`Group`),fl(),Pi(16,`p-select`,12),GI(),fl()(),Pi(17,`div`,13)(18,`p-button`,14),Bh(`onClick`,function(){return i.closeModal()}),fl(),Pi(19,`p-button`,15),Bh(`onClick`,function(){return i.onSubmit()}),fl()()()()}t&2&&(Rh(`searchable`,!0)(`filterable`,!0),dg(`dialogFilterVisible`,i.dialogFilterVisible)(`querySearch`,i.querySearch),iI(7),Jw(wb(13,ge)),Rh(`header`,i.dialogMode()===`edit`?`Edit User`:`Invite User`)(`modal`,!0),dg(`visible`,i.dialogVisible),iI(),Rh(`formGroup`,i.inviteUserForm),iI(4),Rh(`options`,i.userOptions()),QI(),iI(4),Rh(`options`,i.groupOptions()),QI(),iI(3),Rh(`disabled`,!i.isUserAdmin))},dependencies:[gr,Ac,dr,ur,mr,qr,Ee,An,Ai,fh,lh,oh,sh,vl,Tl],styles:[`.p-datatable .p-datatable-thead tr th{background-color:#f6f6f6!important}`],changeDetection:1})}}return n})();export{Ye as UsersComponent};
1
+ import{_ as W,b as Z,f as T,p as U,x as eu,y as Ya}from"./main-Q45KL3O3.js";import{i as ur,n as dr,r as mr,t as Ac}from"./chunk-ANgQsrxT.js";import{t as Ai}from"./chunk-BTkPXAJR.js";import{t as h}from"./chunk-CyE7pq6Z.js";import{f as gr,h as qr,n as An,r as Ee}from"./chunk-DVmYwAhe.js";import"./chunk-CZtkF-WL.js";import"./chunk-DAfeU1o0.js";import{F as fh,K as oh,P as dh,S as Tl,W as lh,X as sh,tt as vl}from"./chunk-CtdBLXrI.js";import{$ as Jw,$n as hb,B as GI,Ci as zu,E,Ft as Rh,G as He,Gn as fs,H as Gu,Hn as fl,Kn as fw,Ot as QI,Qr as sm,St as Pi,Ti as G,Tn as cg,Vn as fg,W as Hb,Xr as rm,ar as hw,bt as Pb,ei as ti,er as hd,fi as wb,gn as _h,ht as Oh,ii as ub,kn as dg,m as Bh,oi as ug,or as iI,qr as ql,qt as Tw,sr as im,u as Aw,wi as F,yn as be$1,yt as PD}from"./chunk-LD3k3Loy.js";var ge=()=>({width:`25rem`});var he=()=>({"min-width":`50rem`});function fe(n,u){if(n&1){let e=Tw();Pi(0,`p-button`,19),Bh(`onClick`,function(){Gu(e);let i=Aw(2);return zu(i.onDeleteUser())}),fl()}}function be(n,u){if(n&1){let e=Tw();Pi(0,`p-button`,20),Bh(`onClick`,function(){Gu(e);let i=Aw(2);return zu(i.openAddUser())}),fl()}}function Ce(n,u){if(n&1&&(Pi(0,`div`,16),fw(1,fe,1,0,`p-button`,17),fw(2,be,1,0,`p-button`,18),fl()),n&2){let e=Aw();iI(),hw(e.userChecked()&&e.userChecked().length>0?1:-1),iI(),hw(e.isUserAdmin?2:-1)}}function Ue(n,u){n&1&&(Pi(0,`th`,23),Oh(1,`p-table-header-checkbox`),fl())}function ye(n,u){if(n&1&&(Pi(0,`tr`),fw(1,Ue,2,0,`th`,23),Pi(2,`th`),ub(3,`Login ID`),fl(),Pi(4,`th`),ub(5,`Group`),fl()()),n&2){let e=Aw(3);iI(),hw(e.isUserAdmin?1:-1)}}function ve(n,u){if(n&1&&(Pi(0,`td`),Oh(1,`p-table-checkbox`,25),fl()),n&2){let e=Aw().$implicit;iI(),Rh(`value`,e)}}function Se(n,u){if(n&1){let e=Tw();Pi(0,`tr`),fw(1,ve,2,1,`td`),Pi(2,`td`)(3,`button`,24),Bh(`click`,function(){let i=Gu(e).$implicit,s=Aw(3);return zu(s.openEditUser(i.UserID))}),Pi(4,`span`),ub(5),fl()()(),Pi(6,`td`),ub(7),fl()()}if(n&2){let e=u.$implicit,t=Aw(3);iI(),hw(t.isUserAdmin?1:-1),iI(4),cg(e.Name),iI(2),cg(e.GroupName)}}function xe(n,u){if(n&1&&ub(0),n&2){let e=Aw(3);ug(` Showing `,e.displayStart(),` to `,e.displayEnd(),` of `,e.userCount(),` entries `)}}function we(n,u){if(n&1){let e=Tw();Pi(0,`p-table`,22),Bh(`onPage`,function(i){Gu(e);let s=Aw(2);return zu(s.pageChange(i))})(`onRowUnselect`,function(i){Gu(e);let s=Aw(2);return zu(s.onRowUnselect(i))})(`onRowSelect`,function(i){Gu(e);let s=Aw(2);return zu(s.onRowSelect(i))}),_h(1,ye,6,1,`ng-template`,null,3,Pb)(3,Se,8,3,`ng-template`,null,4,Pb)(5,xe,1,3,`ng-template`,null,5,Pb),fl()}if(n&2){let e=Aw(2);Rh(`lazy`,!0)(`paginator`,!0)(`rows`,e.rowsPerPage())(`first`,e.firstIndex())(`totalRecords`,e.userCount())(`value`,e.userList())(`tableStyle`,wb(7,he))}}function De(n,u){if(n&1&&(Pi(0,`p-panel`),fw(1,we,7,8,`p-table`,21),fl()),n&2){let e=Aw();iI(),hw(e.filter()?1:-1)}}function Fe(n,u){if(n&1){let e=Tw();Pi(0,`form`,8)(1,`div`,9)(2,`label`,10),ub(3,`Group`),fl(),Pi(4,`p-select`,12),GI(),fl()(),Pi(5,`div`,13)(6,`p-button`,14),Bh(`onClick`,function(){Gu(e);let i=Aw();return zu(i.onCloseFilterDialog())}),fl(),Pi(7,`p-button`,26),Bh(`onClick`,function(){Gu(e);let i=Aw();return zu(i.submitFilter())}),fl()()()}if(n&2){let e=Aw();Rh(`formGroup`,e.dialogFilterForm),iI(4),Rh(`options`,e.groupOptions()),QI()}}var Ye=(()=>{class n{constructor(){this.dialogFilterVisible=ti(!1),this.userList=ti([]),this.groupOptions=ti([]),this.userOptions=ti([]),this.userChecked=ti([]),this.dialogVisible=ti(!1),this.dialogMode=ti(null),this.querySearch=ti(``),this.filter=ti(null),this.userCount=ti(0),this.firstIndex=ti(0),this.rowsPerPage=ti(10),this.displayStart=Hb(()=>{let e=this.userCount();return e===0?0:Math.min(this.firstIndex()+1,e)}),this.displayEnd=Hb(()=>Math.min(this.firstIndex()+this.rowsPerPage(),this.userCount())),this.setupUsersService=E(h),this.fb=E(dh),this.route=E(Z),this.router=E(W),this.destroyRef=E(be$1),this.appStore=E(eu),this.initForm(),this.loadUsers(),this.loadOptions(),this.listenRouteState(),hd(()=>{let e=Object.fromEntries(Object.entries(this.filter()??{}).filter(([t,i])=>i!==Ya));this.loadUsers(e)}),T(this.querySearch).pipe(im(300),sm(),U(this.destroyRef)).subscribe(e=>{this.firstIndex.set(0),this.filter.update(t=>t&&G(F({},t),{Name:e?.trim()?e.trim():`00000000-0000-0000-0000-000000000000`,PageNumber:1}))})}get isUserAdmin(){return this.appStore.userRole()===`admin`}initForm(){this.inviteUserForm=this.fb.group({UserID:this.fb.control(null),GroupID:this.fb.control(null)}),this.dialogFilterForm=this.fb.group({GroupID:this.fb.control(null)})}loadUsers(e){this.setupUsersService.getUserList(e).pipe(ql(t=>{this.userList.set(t.Data),this.userCount.set(t.Count)}),fs(t=>(this.userList.set([]),this.userCount.set(0),He)),U(this.destroyRef)).subscribe()}submitFilter(){if(this.dialogFilterForm.invalid){this.dialogFilterForm.markAllAsTouched();return}let e=this.dialogFilterForm.getRawValue();this.filter.update(t=>t&&G(F({},t),{GroupID:e.GroupID||`00000000-0000-0000-0000-000000000000`,PageNumber:1})),this.dialogFilterVisible.set(!1)}pageChange(e){console.log(e),this.firstIndex.set(e.first??0),this.rowsPerPage.set(e.rows??this.rowsPerPage());let t=(e.first??0)/(e.rows??this.rowsPerPage())+1;this.filter.update(i=>i&&G(F({},i),{PageNumber:t}))}loadOptions(){let e=this.route.snapshot.queryParamMap.has(`id`)?{ID:this.route.snapshot.queryParamMap.get(`id`)||``}:{};rm([this.setupUsersService.getUserListLoader1(),this.setupUsersService.getUserListLoader2(e)]).pipe(ql(([t,i])=>{this.filter.update(()=>G(F({},t.Filter),{Name:t.Filter.Name||`00000000-0000-0000-0000-000000000000`,GroupID:t.Filter.GroupID||`00000000-0000-0000-0000-000000000000`})),this.groupOptions.set(t.Options),this.userOptions.set(i.Data);let s=t.Filter.PageSize??this.rowsPerPage(),f=t.Filter.PageNumber??1;this.rowsPerPage.set(s),this.firstIndex.set((f-1)*s)}),U(this.destroyRef)).subscribe()}listenRouteState(){this.route.queryParamMap.pipe(ql(e=>{let t=e.get(`dialog`),i=e.get(`id`);if(t===`create`){this.dialogMode.update(s=>`create`),this.dialogVisible.update(s=>!0);return}if(t===`edit`&&i){this.dialogMode.update(s=>`edit`),this.dialogVisible.update(s=>!0),this.handleUserEdit(i);return}this.dialogVisible.update(s=>!1),this.dialogMode.update(s=>null)})).subscribe()}openAddUser(){this.router.navigate([],{queryParams:{dialog:`create`},queryParamsHandling:`merge`})}openEditUser(e){this.router.navigate([],{queryParams:{dialog:`edit`,id:e},queryParamsHandling:`merge`})}closeModal(){this.router.navigate([],{queryParams:{dialog:null,id:null},queryParamsHandling:`merge`}),this.inviteUserForm.reset(),this.inviteUserForm.controls.UserID.enable({emitEvent:!1})}resetModalState(){this.dialogMode.update(e=>null),this.inviteUserForm.reset()}onSubmit(){if(this.inviteUserForm.invalid){this.inviteUserForm.markAllAsTouched();return}let e=this.inviteUserForm.getRawValue();(this.dialogMode()===`edit`?this.setupUsersService.updateUser(e.UserID,e.GroupID):this.setupUsersService.inviteUser(e)).pipe(ql(()=>{this.loadUsers(),this.closeModal(),this.userChecked.set([]),this.inviteUserForm.reset(),this.inviteUserForm.controls.UserID.enable({emitEvent:!1})}),U(this.destroyRef)).subscribe()}onDeleteUser(){this.setupUsersService.deleteUser(this.userChecked()).pipe(ql(()=>{this.loadUsers(),this.userChecked.set([])}),U(this.destroyRef)).subscribe()}handleUserEdit(e){this.inviteUserForm.reset(),this.setupUsersService.getUserByID(e).pipe(ql(t=>{this.loadOptions(),this.inviteUserForm.controls.UserID.disable({emitEvent:!1}),this.isUserAdmin||this.inviteUserForm.controls.GroupID.disable({emitEvent:!1}),this.inviteUserForm.patchValue({UserID:t.UserID,GroupID:t.GroupID})}),U(this.destroyRef)).subscribe()}onCloseFilterDialog(){this.dialogFilterVisible.set(!1)}onRowSelect(e){let t=e.data.UserID;this.userChecked().includes(t)||this.userChecked.update(i=>[...i,t])}onRowUnselect(e){if(`UserID`in e.data){let t=e.data?.UserID;if(!t)return;this.userChecked.update(i=>i.filter(s=>s!==t))}}static{this.ɵfac=function(t){return new(t||n)}}static{this.ɵcmp=PD({type:n,selectors:[[`app-users`]],decls:20,vars:14,consts:[[`actionButton`,``],[`content`,``],[`filterDialog`,``],[`header`,``],[`body`,``],[`paginatorleft`,``],[`pageTitle`,`Users`,3,`dialogFilterVisibleChange`,`querySearchChange`,`searchable`,`filterable`,`dialogFilterVisible`,`querySearch`],[`appendTo`,`body`,3,`visibleChange`,`onHide`,`header`,`modal`,`visible`],[1,`d-flex`,`flex-column`,`gap-4`,3,`formGroup`],[1,`form-group`,`d-flex`,`flex-column`,`gap-1`],[`for`,``],[`filter`,``,`filterBy`,`LoginID`,`formControlName`,`UserID`,`appendTo`,`body`,`optionLabel`,`LoginID`,`optionValue`,`ID`,`placeholder`,`Select a User`,3,`options`],[`showClear`,``,`filter`,``,`filterBy`,`Name`,`formControlName`,`GroupID`,`appendTo`,`body`,`optionLabel`,`Name`,`optionValue`,`ID`,`placeholder`,`Select a Group`,3,`options`],[1,`d-flex`,`justify-content-end`,`gap-2`],[`label`,`Cancel`,`outlined`,``,`severity`,`secondary`,3,`onClick`],[`severity`,`info`,`label`,`Save`,3,`onClick`,`disabled`],[1,`d-flex`,`gap-2`,`justify-content-end`,`align-items-center`],[`label`,`Delete`],[`severity`,`info`,`label`,`Invite`],[`label`,`Delete`,3,`onClick`],[`severity`,`info`,`label`,`Invite`,3,`onClick`],[`dataKey`,`UserID`,3,`lazy`,`paginator`,`rows`,`first`,`totalRecords`,`value`,`tableStyle`],[`dataKey`,`UserID`,3,`onPage`,`onRowUnselect`,`onRowSelect`,`lazy`,`paginator`,`rows`,`first`,`totalRecords`,`value`,`tableStyle`],[2,`width`,`4rem`],[1,`btn`,`btn-link`,`link-primary`,`link-underline-opacity-0`,3,`click`],[3,`value`],[`severity`,`info`,`label`,`Apply`,3,`onClick`]],template:function(t,i){if(t&1){let s=Tw();Pi(0,`app-main-panel`,6),fg(`dialogFilterVisibleChange`,function(c){return Gu(s),hb(i.dialogFilterVisible,c)||(i.dialogFilterVisible=c),zu(c)})(`querySearchChange`,function(c){return Gu(s),hb(i.querySearch,c)||(i.querySearch=c),zu(c)}),_h(1,Ce,3,2,`ng-template`,null,0,Pb)(3,De,2,1,`ng-template`,null,1,Pb)(5,Fe,8,2,`ng-template`,null,2,Pb),fl(),Pi(7,`p-dialog`,7),fg(`visibleChange`,function(c){return Gu(s),hb(i.dialogVisible,c)||(i.dialogVisible=c),zu(c)}),Bh(`onHide`,function(){return i.closeModal()}),Pi(8,`form`,8)(9,`div`,9)(10,`label`,10),ub(11,`User`),fl(),Pi(12,`p-select`,11),GI(),fl()(),Pi(13,`div`,9)(14,`label`,10),ub(15,`Group`),fl(),Pi(16,`p-select`,12),GI(),fl()(),Pi(17,`div`,13)(18,`p-button`,14),Bh(`onClick`,function(){return i.closeModal()}),fl(),Pi(19,`p-button`,15),Bh(`onClick`,function(){return i.onSubmit()}),fl()()()()}t&2&&(Rh(`searchable`,!0)(`filterable`,!0),dg(`dialogFilterVisible`,i.dialogFilterVisible)(`querySearch`,i.querySearch),iI(7),Jw(wb(13,ge)),Rh(`header`,i.dialogMode()===`edit`?`Edit User`:`Invite User`)(`modal`,!0),dg(`visible`,i.dialogVisible),iI(),Rh(`formGroup`,i.inviteUserForm),iI(4),Rh(`options`,i.userOptions()),QI(),iI(4),Rh(`options`,i.groupOptions()),QI(),iI(3),Rh(`disabled`,!i.isUserAdmin))},dependencies:[gr,Ac,dr,ur,mr,qr,Ee,An,Ai,fh,lh,oh,sh,vl,Tl],styles:[`.p-datatable .p-datatable-thead tr th{background-color:#f6f6f6!important}`],changeDetection:1})}}return n})();export{Ye as UsersComponent};
@@ -1 +1 @@
1
- import{_ as W$1,m as Ba,u as Sh,v as Xt,x as eu}from"./main-5ONFLEQS.js";import{t as D}from"./chunk-CUqJO8Ae.js";import"./chunk-DAfeU1o0.js";import{D as Xi,F as fh,K as oh,P as dh,S as Tl,X as sh,a as Fs,i as Fo,nt as wl,tt as vl,z as ja}from"./chunk-CtdBLXrI.js";import{B as GI,Ci as zu,Dr as ml,E,Ft as Rh,H as Gu,Hn as fl,Kn as fw,Ot as QI,Rn as ep,St as Pi,Tn as cg,ar as hw,ei as ti,en as Vw,ht as Oh,ii as ub,m as Bh,or as iI,qt as Tw,u as Aw,vn as bb,yt as PD}from"./chunk-LD3k3Loy.js";var P=n=>({active:n});function W(n,_){n&1&&(Pi(0,`h4`),ub(1,`This menu is for printing barcodes that will be placed directly on your products.`),fl())}function X(n,_){n&1&&(Pi(0,`h4`),ub(1,` This option is designed for printing barcodes and labels that will be displayed on the shelves where your products are stored. `),fl())}function Y(n,_){n&1&&(Pi(0,`h4`),ub(1,`This option is for setting up user accounts and managing user permissions.`),fl())}function Z(n,_){if(n&1){let l=Tw();Pi(0,`div`,27),Bh(`click`,function(){Gu(l),Aw();let o=Vw(36);return zu(o.click())}),Pi(1,`div`,28)(2,`div`,29),Oh(3,`i`,7),fl(),Pi(4,`h6`,31),ub(5,`Setup`),fl(),Pi(6,`h4`,32),ub(7,`Users`),fl()()()}if(n&2){let l=Aw();Rh(`ngClass`,bb(1,P,l.form.get(`printMode`).value===3))}}var pe=(()=>{class n{constructor(){this.domain=ti(``),this.username=ti(``),this.appStore=E(eu),this.router=E(W$1),this.fb=E(dh),this.authService=E(Sh)}ngOnInit(){this.initForm()}ngAfterViewInit(){this.domain.set(localStorage.getItem(Xt.Host)),this.username.set(localStorage.getItem(Xt.Username))}onNext(){let l=this.form.get(`printMode`).value;switch(this.appStore.clearAll(),l){case 1:this.form.get(`rememberMe`).value&&localStorage.setItem(Xt.PrintMode,`barcode`),this.router.navigate([`/pages/profile-template`]);break;case 2:this.form.get(`rememberMe`).value&&localStorage.setItem(Xt.PrintMode,`priceLabel`),this.router.navigate([`/pages/price-label`]);break;case 3:this.form.get(`rememberMe`).value&&localStorage.setItem(Xt.PrintMode,`setupUsers`),this.router.navigate([`/pages/setup/users`]);break;default:console.error(`Unknown print mode selected:`,l)}}initForm(){this.form=this.fb.group({printMode:this.fb.control(localStorage.getItem(Xt.PrintMode)===`priceLabel`?2:1),rememberMe:this.fb.control(!0)})}get isUserAdmin(){return this.appStore.userRole()===`admin`}static{this.ɵfac=function(s){return new(s||n)}}static{this.ɵcmp=PD({type:n,selectors:[[`app-print-mode-selector`]],decls:63,vars:17,consts:[[`radioDefault1`,``],[`radioDefault2`,``],[`radioDefault3`,``],[1,`navbar`,`navbar-light`,`bg-white`,`shadow-sm`,`px-4`,`py-2`],[1,`fw-normal`,`mt-2`],[1,`dropdown`],[`type`,`button`,`id`,`profileMenu`,`data-bs-toggle`,`dropdown`,`aria-expanded`,`false`,1,`btn`,`btn-light`,`rounded-circle`,`d-flex`,`align-items-center`,`justify-content-center`,2,`width`,`40px`,`height`,`40px`],[1,`fa-solid`,`fa-user`],[`aria-labelledby`,`profileMenu`,1,`dropdown-menu`,`dropdown-menu-end`,`shadow`,`border-0`,`p-3`,2,`width`,`250px`,`border-radius`,`1rem`],[1,`mb-2`],[1,`fw-bold`,`text-uppercase`],[1,`d-flex`,`align-items-center`,`mb-3`],[1,`me-3`],[1,`fa-solid`,`fa-user-circle`,`fa-3x`,`text-secondary`],[1,`mt-3`,`fw-bold`],[1,`text-muted`,`fw-bolder`],[`rel`,`noopener noreferrer`,`target`,`_blank`,1,`text-primary`,`text-decoration-none`,3,`href`],[1,`dropdown-divider`],[`href`,`javascript:void(0)`,1,`btn`,`btn-primary`,`w-100`,`rounded-pill`,3,`click`],[1,`d-flex`,`flex-column`,2,`height`,`calc(100vh - 56px)`],[1,`flex-grow-1`,`w-100`,`d-flex`,`flex-column`,`justify-content-center`,`align-items-center`,`gap-4`,`px-3`],[`id`,`header`,1,`text-center`,`mb-4`],[1,`row`,`g-4`,`justify-content-center`,`w-100`,2,`max-width`,`960px`,3,`formGroup`],[`formControlName`,`printMode`,`type`,`radio`,`name`,`printMode`,1,`form-check-input`,`d-none`,3,`value`],[`formControlName`,`printMode`,`type`,`radio`,`name`,`printMode`,`checked`,``,1,`form-check-input`,`d-none`,3,`value`],[1,`d-flex`,`flex-column`,`align-items-center`,`gap-4`,`w-100`],[1,`d-flex`,`gap-5`,`justify-content-center`,`flex-wrap`],[1,`card`,`option-card`,3,`click`,`ngClass`],[1,`card-body`,`text-center`],[1,`icon-wrapper`,`mb-2`,`mt-4`],[1,`fa-solid`,`fa-barcode`],[1,`text-muted`,`mb-1`],[1,`fw-normal`],[1,`fa-solid`,`fa-shelves`],[1,`card`,`option-card`,3,`ngClass`],[1,`form-check`,`d-flex`,`justify-content-center`,`align-items-center`,`gap-2`,`mt-3`],[`type`,`checkbox`,`formControlName`,`rememberMe`,`id`,`checkDefault`,1,`form-check-input`],[`for`,`checkDefault`,1,`form-check-label`],[1,`mt-3`],[`type`,`button`,1,`btn`,`btn-primary`,`btn-lg`,`px-5`,`rounded-pill`,`shadow-lg`,3,`click`]],template:function(s,o){if(s&1){let E=Tw();Pi(0,`nav`,3)(1,`h2`,4),ub(2,`Choose Barcode Mode`),fl(),Pi(3,`div`,5)(4,`button`,6),Oh(5,`i`,7),fl(),Pi(6,`ul`,8)(7,`li`,9)(8,`span`,10),ub(9,`User Profile`),fl()(),Pi(10,`li`,11)(11,`div`,12),Oh(12,`i`,13),fl(),Pi(13,`div`)(14,`h6`,14),ub(15),fl(),Pi(16,`h6`,15)(17,`a`,16),ub(18),fl()()()(),Pi(19,`li`),Oh(20,`hr`,17),fl(),Pi(21,`li`)(22,`button`,18),Bh(`click`,function(){return o.authService.logout()}),ub(23,` SIGN OUT `),fl()()()()(),Pi(24,`div`,19)(25,`main`,20)(26,`div`,21),fw(27,W,2,0,`h4`),fw(28,X,2,0,`h4`),fw(29,Y,2,0,`h4`),fl(),Pi(30,`div`,22)(31,`input`,23,0),GI(),fl(),Pi(33,`input`,24,1),GI(),fl(),Pi(35,`input`,24,2),GI(),fl(),Pi(37,`div`,25)(38,`div`,26)(39,`div`,27),Bh(`click`,function(){Gu(E);let M=Vw(32);return zu(M.click())}),Pi(40,`div`,28)(41,`div`,29),Oh(42,`i`,30),fl(),Pi(43,`h6`,31),ub(44,`Print`),fl(),Pi(45,`h4`,32),ub(46,`Product`),fl()()(),Pi(47,`div`,27),Bh(`click`,function(){Gu(E);let M=Vw(34);return zu(M.click())}),Pi(48,`div`,28)(49,`div`,29),Oh(50,`i`,33),fl(),Pi(51,`h6`,31),ub(52,`Print`),fl(),Pi(53,`h4`,32),ub(54,`Shelf`),fl()()(),fw(55,Z,8,3,`div`,34),fl(),Pi(56,`div`,35)(57,`input`,36),GI(),fl(),Pi(58,`label`,37),ub(59,`Remember my decision`),fl()(),Pi(60,`div`,38)(61,`button`,39),Bh(`click`,function(){return o.onNext()}),ub(62,` Next `),fl()()()()()()}s&2&&(iI(15),cg(o.username()),iI(2),Rh(`href`,`https://`+o.domain(),ep),iI(),ml(` `,o.domain(),` `),iI(9),hw(o.form.get(`printMode`).value===1?27:-1),iI(),hw(o.form.get(`printMode`).value===2?28:-1),iI(),hw(o.form.get(`printMode`).value===3?29:-1),iI(),Rh(`formGroup`,o.form),iI(),Rh(`value`,1),QI(),iI(2),Rh(`value`,2),QI(),iI(2),Rh(`value`,3),QI(),iI(4),Rh(`ngClass`,bb(13,P,o.form.get(`printMode`).value===1)),iI(8),Rh(`ngClass`,bb(15,P,o.form.get(`printMode`).value===2)),iI(8),hw(o.isUserAdmin?55:-1),iI(2),QI())},dependencies:[Xi,Fs,Ba,fh,Fo,ja,wl,oh,sh,vl,Tl,D],styles:[`[_nghost-%COMP%]{display:block}main[_ngcontent-%COMP%]{background-color:#f5f5f5}.card[_ngcontent-%COMP%]{width:205px;height:205px;border-radius:8px;transition:transform .3s ease,border-color .3s ease}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:4rem}.card.active[_ngcontent-%COMP%]{border:2px solid blue;transform:scale(1.05)}.dropdown-menu[_ngcontent-%COMP%]{position:absolute;right:0}#header[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin:0}#header[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]:nth-child(1){font-size:2rem;font-weight:500}#header[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]:nth-child(2){font-size:.8rem}`]})}}return n})();export{pe as PrintModeSelectorComponent};
1
+ import{_ as W$1,m as Ba,u as Sh,v as Xt,x as eu}from"./main-Q45KL3O3.js";import{t as D}from"./chunk-CUqJO8Ae.js";import"./chunk-DAfeU1o0.js";import{D as Xi,F as fh,K as oh,P as dh,S as Tl,X as sh,a as Fs,i as Fo,nt as wl,tt as vl,z as ja}from"./chunk-CtdBLXrI.js";import{B as GI,Ci as zu,Dr as ml,E,Ft as Rh,H as Gu,Hn as fl,Kn as fw,Ot as QI,Rn as ep,St as Pi,Tn as cg,ar as hw,ei as ti,en as Vw,ht as Oh,ii as ub,m as Bh,or as iI,qt as Tw,u as Aw,vn as bb,yt as PD}from"./chunk-LD3k3Loy.js";var P=n=>({active:n});function W(n,_){n&1&&(Pi(0,`h4`),ub(1,`This menu is for printing barcodes that will be placed directly on your products.`),fl())}function X(n,_){n&1&&(Pi(0,`h4`),ub(1,` This option is designed for printing barcodes and labels that will be displayed on the shelves where your products are stored. `),fl())}function Y(n,_){n&1&&(Pi(0,`h4`),ub(1,`This option is for setting up user accounts and managing user permissions.`),fl())}function Z(n,_){if(n&1){let l=Tw();Pi(0,`div`,27),Bh(`click`,function(){Gu(l),Aw();let o=Vw(36);return zu(o.click())}),Pi(1,`div`,28)(2,`div`,29),Oh(3,`i`,7),fl(),Pi(4,`h6`,31),ub(5,`Setup`),fl(),Pi(6,`h4`,32),ub(7,`Users`),fl()()()}if(n&2){let l=Aw();Rh(`ngClass`,bb(1,P,l.form.get(`printMode`).value===3))}}var pe=(()=>{class n{constructor(){this.domain=ti(``),this.username=ti(``),this.appStore=E(eu),this.router=E(W$1),this.fb=E(dh),this.authService=E(Sh)}ngOnInit(){this.initForm()}ngAfterViewInit(){this.domain.set(localStorage.getItem(Xt.Host)),this.username.set(localStorage.getItem(Xt.Username))}onNext(){let l=this.form.get(`printMode`).value;switch(this.appStore.clearAll(),l){case 1:this.form.get(`rememberMe`).value&&localStorage.setItem(Xt.PrintMode,`barcode`),this.router.navigate([`/pages/profile-template`]);break;case 2:this.form.get(`rememberMe`).value&&localStorage.setItem(Xt.PrintMode,`priceLabel`),this.router.navigate([`/pages/price-label`]);break;case 3:this.form.get(`rememberMe`).value&&localStorage.setItem(Xt.PrintMode,`setupUsers`),this.router.navigate([`/pages/setup/users`]);break;default:console.error(`Unknown print mode selected:`,l)}}initForm(){this.form=this.fb.group({printMode:this.fb.control(localStorage.getItem(Xt.PrintMode)===`priceLabel`?2:1),rememberMe:this.fb.control(!0)})}get isUserAdmin(){return this.appStore.userRole()===`admin`}static{this.ɵfac=function(s){return new(s||n)}}static{this.ɵcmp=PD({type:n,selectors:[[`app-print-mode-selector`]],decls:63,vars:17,consts:[[`radioDefault1`,``],[`radioDefault2`,``],[`radioDefault3`,``],[1,`navbar`,`navbar-light`,`bg-white`,`shadow-sm`,`px-4`,`py-2`],[1,`fw-normal`,`mt-2`],[1,`dropdown`],[`type`,`button`,`id`,`profileMenu`,`data-bs-toggle`,`dropdown`,`aria-expanded`,`false`,1,`btn`,`btn-light`,`rounded-circle`,`d-flex`,`align-items-center`,`justify-content-center`,2,`width`,`40px`,`height`,`40px`],[1,`fa-solid`,`fa-user`],[`aria-labelledby`,`profileMenu`,1,`dropdown-menu`,`dropdown-menu-end`,`shadow`,`border-0`,`p-3`,2,`width`,`250px`,`border-radius`,`1rem`],[1,`mb-2`],[1,`fw-bold`,`text-uppercase`],[1,`d-flex`,`align-items-center`,`mb-3`],[1,`me-3`],[1,`fa-solid`,`fa-user-circle`,`fa-3x`,`text-secondary`],[1,`mt-3`,`fw-bold`],[1,`text-muted`,`fw-bolder`],[`rel`,`noopener noreferrer`,`target`,`_blank`,1,`text-primary`,`text-decoration-none`,3,`href`],[1,`dropdown-divider`],[`href`,`javascript:void(0)`,1,`btn`,`btn-primary`,`w-100`,`rounded-pill`,3,`click`],[1,`d-flex`,`flex-column`,2,`height`,`calc(100vh - 56px)`],[1,`flex-grow-1`,`w-100`,`d-flex`,`flex-column`,`justify-content-center`,`align-items-center`,`gap-4`,`px-3`],[`id`,`header`,1,`text-center`,`mb-4`],[1,`row`,`g-4`,`justify-content-center`,`w-100`,2,`max-width`,`960px`,3,`formGroup`],[`formControlName`,`printMode`,`type`,`radio`,`name`,`printMode`,1,`form-check-input`,`d-none`,3,`value`],[`formControlName`,`printMode`,`type`,`radio`,`name`,`printMode`,`checked`,``,1,`form-check-input`,`d-none`,3,`value`],[1,`d-flex`,`flex-column`,`align-items-center`,`gap-4`,`w-100`],[1,`d-flex`,`gap-5`,`justify-content-center`,`flex-wrap`],[1,`card`,`option-card`,3,`click`,`ngClass`],[1,`card-body`,`text-center`],[1,`icon-wrapper`,`mb-2`,`mt-4`],[1,`fa-solid`,`fa-barcode`],[1,`text-muted`,`mb-1`],[1,`fw-normal`],[1,`fa-solid`,`fa-shelves`],[1,`card`,`option-card`,3,`ngClass`],[1,`form-check`,`d-flex`,`justify-content-center`,`align-items-center`,`gap-2`,`mt-3`],[`type`,`checkbox`,`formControlName`,`rememberMe`,`id`,`checkDefault`,1,`form-check-input`],[`for`,`checkDefault`,1,`form-check-label`],[1,`mt-3`],[`type`,`button`,1,`btn`,`btn-primary`,`btn-lg`,`px-5`,`rounded-pill`,`shadow-lg`,3,`click`]],template:function(s,o){if(s&1){let E=Tw();Pi(0,`nav`,3)(1,`h2`,4),ub(2,`Choose Barcode Mode`),fl(),Pi(3,`div`,5)(4,`button`,6),Oh(5,`i`,7),fl(),Pi(6,`ul`,8)(7,`li`,9)(8,`span`,10),ub(9,`User Profile`),fl()(),Pi(10,`li`,11)(11,`div`,12),Oh(12,`i`,13),fl(),Pi(13,`div`)(14,`h6`,14),ub(15),fl(),Pi(16,`h6`,15)(17,`a`,16),ub(18),fl()()()(),Pi(19,`li`),Oh(20,`hr`,17),fl(),Pi(21,`li`)(22,`button`,18),Bh(`click`,function(){return o.authService.logout()}),ub(23,` SIGN OUT `),fl()()()()(),Pi(24,`div`,19)(25,`main`,20)(26,`div`,21),fw(27,W,2,0,`h4`),fw(28,X,2,0,`h4`),fw(29,Y,2,0,`h4`),fl(),Pi(30,`div`,22)(31,`input`,23,0),GI(),fl(),Pi(33,`input`,24,1),GI(),fl(),Pi(35,`input`,24,2),GI(),fl(),Pi(37,`div`,25)(38,`div`,26)(39,`div`,27),Bh(`click`,function(){Gu(E);let M=Vw(32);return zu(M.click())}),Pi(40,`div`,28)(41,`div`,29),Oh(42,`i`,30),fl(),Pi(43,`h6`,31),ub(44,`Print`),fl(),Pi(45,`h4`,32),ub(46,`Product`),fl()()(),Pi(47,`div`,27),Bh(`click`,function(){Gu(E);let M=Vw(34);return zu(M.click())}),Pi(48,`div`,28)(49,`div`,29),Oh(50,`i`,33),fl(),Pi(51,`h6`,31),ub(52,`Print`),fl(),Pi(53,`h4`,32),ub(54,`Shelf`),fl()()(),fw(55,Z,8,3,`div`,34),fl(),Pi(56,`div`,35)(57,`input`,36),GI(),fl(),Pi(58,`label`,37),ub(59,`Remember my decision`),fl()(),Pi(60,`div`,38)(61,`button`,39),Bh(`click`,function(){return o.onNext()}),ub(62,` Next `),fl()()()()()()}s&2&&(iI(15),cg(o.username()),iI(2),Rh(`href`,`https://`+o.domain(),ep),iI(),ml(` `,o.domain(),` `),iI(9),hw(o.form.get(`printMode`).value===1?27:-1),iI(),hw(o.form.get(`printMode`).value===2?28:-1),iI(),hw(o.form.get(`printMode`).value===3?29:-1),iI(),Rh(`formGroup`,o.form),iI(),Rh(`value`,1),QI(),iI(2),Rh(`value`,2),QI(),iI(2),Rh(`value`,3),QI(),iI(4),Rh(`ngClass`,bb(13,P,o.form.get(`printMode`).value===1)),iI(8),Rh(`ngClass`,bb(15,P,o.form.get(`printMode`).value===2)),iI(8),hw(o.isUserAdmin?55:-1),iI(2),QI())},dependencies:[Xi,Fs,Ba,fh,Fo,ja,wl,oh,sh,vl,Tl,D],styles:[`[_nghost-%COMP%]{display:block}main[_ngcontent-%COMP%]{background-color:#f5f5f5}.card[_ngcontent-%COMP%]{width:205px;height:205px;border-radius:8px;transition:transform .3s ease,border-color .3s ease}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:4rem}.card.active[_ngcontent-%COMP%]{border:2px solid blue;transform:scale(1.05)}.dropdown-menu[_ngcontent-%COMP%]{position:absolute;right:0}#header[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin:0}#header[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]:nth-child(1){font-size:2rem;font-weight:500}#header[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]:nth-child(2){font-size:.8rem}`]})}}return n})();export{pe as PrintModeSelectorComponent};
@@ -1,4 +1,4 @@
1
- import{d as F,l as xt,o as Rt,s as Wt}from"./main-5ONFLEQS.js";import{a as Mn,c as Sn,d as gn,m as mn,o as Qt}from"./chunk-DVmYwAhe.js";import{$ as gl,B as Zi,Ct as vo,D as Sl,Dt as yi$1,E as Qi,H as _t,I as Wl,J as dl,L as Xi,Mt as zr,O as Su,Ot as yl,P as Ur,Q as gd,T as Po,V as _l,W as al,X as fe,Z as fl,_ as Hl,a as Al,at as ks,b as Kr,bt as ul,et as hd,ht as si,i as Ai$1,jt as zl,mt as rp,nt as it,ot as ll,pt as rl,q as ct,r as Ac,rt as ja,s as At,st as md,t as $,u as Cl,vt as tu,w as Ol,z as Ze}from"./chunk-CZtkF-WL.js";import{Y as sc,it as xe,ot as xs}from"./chunk-CtdBLXrI.js";import{$ as Jw,Ci as zu,Dr as ml,Dt as Q1,E,Fr as od,Ft as Rh,H as Gu,Hn as fl$1,Kn as fw,Lr as ov,Pn as eb,Qn as gw,S as Db,St as Pi$1,Ti as G,Tn as cg,Ur as q1,Ut as Tg,V as Gh,W as Hb,Wt as Th,X as Jh,Yt as U1,_r as kh,_t as Ow,ai as ue,ar as hw,bi as zh,br as kw,bt as Pb,c as Ah,di as vw,ei as ti,en as Vw,er as hd$1,f as BD,fi as wb,fr as jw,ft as O1,gi as x,gn as _h,ht as Oh,ii as ub,j as F1,m as Bh,nn as W1,or as iI,pr as k1,qt as Tw,tt as L1,u as Aw,ur as jD,vi as yw,vn as bb,vt as P1,w as Du,wi as F$1,xt as Ph,yr as ko,yt as PD,z as GD}from"./chunk-LD3k3Loy.js";var fi={name:`search`,meta:{tags:[`search`,`find`,`query`,`lookup`,`discover`]},svg:{xmlns:`http://www.w3.org/2000/svg`,width:20,height:20,viewBox:`0 0 20 20`,fill:`none`},nodes:[[`path`,{d:`M8.76953 1.25C12.9226 1.25 16.2898 4.61656 16.29 8.76953C16.29 10.576 15.6515 12.2326 14.5898 13.5293L18.5303 17.4697C18.823 17.7626 18.8231 18.2374 18.5303 18.5303C18.2374 18.8231 17.7626 18.823 17.4697 18.5303L13.5293 14.5898C12.2326 15.6515 10.576 16.29 8.76953 16.29C4.61656 16.2898 1.25 12.9226 1.25 8.76953C1.25025 4.61672 4.61672 1.25025 8.76953 1.25ZM8.76953 2.75C5.44515 2.75025 2.75025 5.44514 2.75 8.76953C2.75 12.0941 5.44499 14.7898 8.76953 14.79C12.0943 14.79 14.79 12.0943 14.79 8.76953C14.7898 5.445 12.0941 2.75 8.76953 2.75Z`,fill:`currentColor`,key:`nt0lcw`}]]};var yi=(()=>{class m extends Kr{constructor(){super(),this._icon=fi}static ɵfac=function(n){return new(n||m)};static ɵcmp=(function(){let e=(r,g)=>g[1].key||r;function n(r,g){if(r&1&&(od(),kh(0,`path`)),r&2){let t=Aw().$implicit;Ah(`d`,t[1].d)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`fill-rule`,t[1].fillRule)(`clip-rule`,t[1].clipRule)(`stroke`,t[1].stroke)(`stroke-width`,t[1].strokeWidth)(`stroke-opacity`,t[1].strokeOpacity)(`opacity`,t[1].opacity)}}function o(r,g){if(r&1&&(od(),kh(0,`circle`)),r&2){let t=Aw().$implicit;Ah(`cx`,t[1].cx)(`cy`,t[1].cy)(`r`,t[1].r)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function p(r,g){if(r&1&&(od(),kh(0,`rect`)),r&2){let t=Aw().$implicit;Ah(`x`,t[1].x)(`y`,t[1].y)(`width`,t[1].width)(`height`,t[1].height)(`rx`,t[1].rx)(`ry`,t[1].ry)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function d(r,g){if(r&1&&(od(),kh(0,`line`)),r&2){let t=Aw().$implicit;Ah(`x1`,t[1].x1)(`y1`,t[1].y1)(`x2`,t[1].x2)(`y2`,t[1].y2)(`stroke`,t[1].stroke)(`stroke-opacity`,t[1].strokeOpacity)(`opacity`,t[1].opacity)}}function u(r,g){if(r&1&&(od(),kh(0,`polyline`)),r&2){let t=Aw().$implicit;Ah(`points`,t[1].points)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function C(r,g){if(r&1&&(od(),kh(0,`polygon`)),r&2){let t=Aw().$implicit;Ah(`points`,t[1].points)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function y(r,g){if(r&1&&(od(),kh(0,`ellipse`)),r&2){let t=Aw().$implicit;Ah(`cx`,t[1].cx)(`cy`,t[1].cy)(`rx`,t[1].rx)(`ry`,t[1].ry)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function V(r,g){if(r&1&&fw(0,n,1,9,`path`)(1,o,1,6,`circle`)(2,p,1,9,`rect`)(3,d,1,7,`line`)(4,u,1,4,`polyline`)(5,C,1,4,`polygon`)(6,y,1,7,`ellipse`),r&2){let t,z=g.$implicit;hw((t=z[0])===`path`?0:t===`circle`?1:t===`rect`?2:t===`line`?3:t===`polyline`?4:t===`polygon`?5:t===`ellipse`?6:-1)}}return PD({type:m,selectors:[[`svg`,`data-p-icon`,`search`]],features:[Th],decls:2,vars:0,template:function(g,t){g&1&&yw(0,V,7,1,null,null,e),g&2&&vw(t.iconNodes())},encapsulation:2,changeDetection:1})})()}return m})();var _i=class mt extends Mn{required=k1(void 0,{transform:U1});invalid=k1(void 0,{transform:U1});disabled=k1(void 0,{transform:U1});name=k1();_disabled=ti(!1);$disabled=Hb(()=>this.disabled()||this._disabled());onModelChange=()=>{};onModelTouched=()=>{};writeDisabledState(e){this._disabled.set(e)}writeControlValue(e,n){}writeValue(e){this.writeControlValue(e,this.writeModelValue.bind(this))}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.writeDisabledState(e),this.cd.markForCheck()}static ɵfac=(()=>{let e;return function(o){return(e||(e=ov(mt)))(o||mt)}})();static ɵdir=BD({type:mt,inputs:{required:[1,`required`],invalid:[1,`invalid`],disabled:[1,`disabled`],name:[1,`name`]},features:[Th]})};var vi=class ht extends _i{pcFluid=E(Qt,{optional:!0,host:!0,skipSelf:!0});fluid=k1(void 0,{transform:U1});variant=k1();size=k1();inputSize=k1();pattern=k1();min=k1();max=k1();step=k1();minlength=k1();maxlength=k1();$variant=Hb(()=>this.variant()||this.config.inputVariant()||void 0);$pattern=Hb(()=>{let e=this.pattern();return typeof e==`string`&&e.length>0?e:void 0});get hasFluid(){return this.fluid()??!!this.pcFluid}static ɵfac=(()=>{let e;return function(o){return(e||(e=ov(ht)))(o||ht)}})();static ɵdir=BD({type:ht,inputs:{fluid:[1,`fluid`],variant:[1,`variant`],size:[1,`size`],inputSize:[1,`inputSize`],pattern:[1,`pattern`],min:[1,`min`],max:[1,`max`],step:[1,`step`],minlength:[1,`minlength`],maxlength:[1,`maxlength`]},features:[Th]})};var bi=`
1
+ import{d as F,l as xt,o as Rt,s as Wt}from"./main-Q45KL3O3.js";import{a as Mn,c as Sn,d as gn,m as mn,o as Qt}from"./chunk-DVmYwAhe.js";import{$ as gl,B as Zi,Ct as vo,D as Sl,Dt as yi$1,E as Qi,H as _t,I as Wl,J as dl,L as Xi,Mt as zr,O as Su,Ot as yl,P as Ur,Q as gd,T as Po,V as _l,W as al,X as fe,Z as fl,_ as Hl,a as Al,at as ks,b as Kr,bt as ul,et as hd,ht as si,i as Ai$1,jt as zl,mt as rp,nt as it,ot as ll,pt as rl,q as ct,r as Ac,rt as ja,s as At,st as md,t as $,u as Cl,vt as tu,w as Ol,z as Ze}from"./chunk-CZtkF-WL.js";import{Y as sc,it as xe,ot as xs}from"./chunk-CtdBLXrI.js";import{$ as Jw,Ci as zu,Dr as ml,Dt as Q1,E,Fr as od,Ft as Rh,H as Gu,Hn as fl$1,Kn as fw,Lr as ov,Pn as eb,Qn as gw,S as Db,St as Pi$1,Ti as G,Tn as cg,Ur as q1,Ut as Tg,V as Gh,W as Hb,Wt as Th,X as Jh,Yt as U1,_r as kh,_t as Ow,ai as ue,ar as hw,bi as zh,br as kw,bt as Pb,c as Ah,di as vw,ei as ti,en as Vw,er as hd$1,f as BD,fi as wb,fr as jw,ft as O1,gi as x,gn as _h,ht as Oh,ii as ub,j as F1,m as Bh,nn as W1,or as iI,pr as k1,qt as Tw,tt as L1,u as Aw,ur as jD,vi as yw,vn as bb,vt as P1,w as Du,wi as F$1,xt as Ph,yr as ko,yt as PD,z as GD}from"./chunk-LD3k3Loy.js";var fi={name:`search`,meta:{tags:[`search`,`find`,`query`,`lookup`,`discover`]},svg:{xmlns:`http://www.w3.org/2000/svg`,width:20,height:20,viewBox:`0 0 20 20`,fill:`none`},nodes:[[`path`,{d:`M8.76953 1.25C12.9226 1.25 16.2898 4.61656 16.29 8.76953C16.29 10.576 15.6515 12.2326 14.5898 13.5293L18.5303 17.4697C18.823 17.7626 18.8231 18.2374 18.5303 18.5303C18.2374 18.8231 17.7626 18.823 17.4697 18.5303L13.5293 14.5898C12.2326 15.6515 10.576 16.29 8.76953 16.29C4.61656 16.2898 1.25 12.9226 1.25 8.76953C1.25025 4.61672 4.61672 1.25025 8.76953 1.25ZM8.76953 2.75C5.44515 2.75025 2.75025 5.44514 2.75 8.76953C2.75 12.0941 5.44499 14.7898 8.76953 14.79C12.0943 14.79 14.79 12.0943 14.79 8.76953C14.7898 5.445 12.0941 2.75 8.76953 2.75Z`,fill:`currentColor`,key:`nt0lcw`}]]};var yi=(()=>{class m extends Kr{constructor(){super(),this._icon=fi}static ɵfac=function(n){return new(n||m)};static ɵcmp=(function(){let e=(r,g)=>g[1].key||r;function n(r,g){if(r&1&&(od(),kh(0,`path`)),r&2){let t=Aw().$implicit;Ah(`d`,t[1].d)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`fill-rule`,t[1].fillRule)(`clip-rule`,t[1].clipRule)(`stroke`,t[1].stroke)(`stroke-width`,t[1].strokeWidth)(`stroke-opacity`,t[1].strokeOpacity)(`opacity`,t[1].opacity)}}function o(r,g){if(r&1&&(od(),kh(0,`circle`)),r&2){let t=Aw().$implicit;Ah(`cx`,t[1].cx)(`cy`,t[1].cy)(`r`,t[1].r)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function p(r,g){if(r&1&&(od(),kh(0,`rect`)),r&2){let t=Aw().$implicit;Ah(`x`,t[1].x)(`y`,t[1].y)(`width`,t[1].width)(`height`,t[1].height)(`rx`,t[1].rx)(`ry`,t[1].ry)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function d(r,g){if(r&1&&(od(),kh(0,`line`)),r&2){let t=Aw().$implicit;Ah(`x1`,t[1].x1)(`y1`,t[1].y1)(`x2`,t[1].x2)(`y2`,t[1].y2)(`stroke`,t[1].stroke)(`stroke-opacity`,t[1].strokeOpacity)(`opacity`,t[1].opacity)}}function u(r,g){if(r&1&&(od(),kh(0,`polyline`)),r&2){let t=Aw().$implicit;Ah(`points`,t[1].points)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function C(r,g){if(r&1&&(od(),kh(0,`polygon`)),r&2){let t=Aw().$implicit;Ah(`points`,t[1].points)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function y(r,g){if(r&1&&(od(),kh(0,`ellipse`)),r&2){let t=Aw().$implicit;Ah(`cx`,t[1].cx)(`cy`,t[1].cy)(`rx`,t[1].rx)(`ry`,t[1].ry)(`fill`,t[1].fill)(`fill-opacity`,t[1].fillOpacity)(`opacity`,t[1].opacity)}}function V(r,g){if(r&1&&fw(0,n,1,9,`path`)(1,o,1,6,`circle`)(2,p,1,9,`rect`)(3,d,1,7,`line`)(4,u,1,4,`polyline`)(5,C,1,4,`polygon`)(6,y,1,7,`ellipse`),r&2){let t,z=g.$implicit;hw((t=z[0])===`path`?0:t===`circle`?1:t===`rect`?2:t===`line`?3:t===`polyline`?4:t===`polygon`?5:t===`ellipse`?6:-1)}}return PD({type:m,selectors:[[`svg`,`data-p-icon`,`search`]],features:[Th],decls:2,vars:0,template:function(g,t){g&1&&yw(0,V,7,1,null,null,e),g&2&&vw(t.iconNodes())},encapsulation:2,changeDetection:1})})()}return m})();var _i=class mt extends Mn{required=k1(void 0,{transform:U1});invalid=k1(void 0,{transform:U1});disabled=k1(void 0,{transform:U1});name=k1();_disabled=ti(!1);$disabled=Hb(()=>this.disabled()||this._disabled());onModelChange=()=>{};onModelTouched=()=>{};writeDisabledState(e){this._disabled.set(e)}writeControlValue(e,n){}writeValue(e){this.writeControlValue(e,this.writeModelValue.bind(this))}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.writeDisabledState(e),this.cd.markForCheck()}static ɵfac=(()=>{let e;return function(o){return(e||(e=ov(mt)))(o||mt)}})();static ɵdir=BD({type:mt,inputs:{required:[1,`required`],invalid:[1,`invalid`],disabled:[1,`disabled`],name:[1,`name`]},features:[Th]})};var vi=class ht extends _i{pcFluid=E(Qt,{optional:!0,host:!0,skipSelf:!0});fluid=k1(void 0,{transform:U1});variant=k1();size=k1();inputSize=k1();pattern=k1();min=k1();max=k1();step=k1();minlength=k1();maxlength=k1();$variant=Hb(()=>this.variant()||this.config.inputVariant()||void 0);$pattern=Hb(()=>{let e=this.pattern();return typeof e==`string`&&e.length>0?e:void 0});get hasFluid(){return this.fluid()??!!this.pcFluid}static ɵfac=(()=>{let e;return function(o){return(e||(e=ov(ht)))(o||ht)}})();static ɵdir=BD({type:ht,inputs:{fluid:[1,`fluid`],variant:[1,`variant`],size:[1,`size`],inputSize:[1,`inputSize`],pattern:[1,`pattern`],min:[1,`min`],max:[1,`max`],step:[1,`step`],minlength:[1,`minlength`],maxlength:[1,`maxlength`]},features:[Th]})};var bi=`
2
2
  .p-iconfield {
3
3
  position: relative;
4
4
  display: block;
@@ -0,0 +1,63 @@
1
+ import{_ as W,a as In,b as Z,v as Xt$1,x as eu}from"./main-Q45KL3O3.js";import{t as D}from"./chunk-CUqJO8Ae.js";import{a as dj,i as bV,n as Rg,o as rd,r as Ul,s as vz,t as Hl}from"./chunk-Bt9WVrBi.js";import"./chunk-BUsg5rFD.js";import"./chunk-BTkPXAJR.js";import{t as i}from"./chunk-CKXRHkCI.js";import{c as Sn,f as gr,i as Gn,n as An,r as Ee,t as $n}from"./chunk-DVmYwAhe.js";import{$ as gl,At as ze,Dt as yi,I as Wl,J as dl,O as Su,Q as gd,X as fe,Y as el,Z as fl,et as hd,j as Tl,q as ct,r as Ac,s as At$1,w as Ol,wt as vu,y as Ji,z as Ze}from"./chunk-CZtkF-WL.js";import"./chunk-DAfeU1o0.js";import{D as Xi,F as fh,K as oh,P as dh,R as hh,S as Tl$1,X as sh,Y as sc,a as Fs,h as Ns,i as Fo,ot as xs,tt as vl,w as Us}from"./chunk-CtdBLXrI.js";import{$ as Jw,$n as hb,B as GI,Ci as zu,Dr as ml,E,Ft as Rh,Gn as fs,H as Gu,Hn as fl$1,Kn as fw,Lr as ov,Ot as QI,Pn as eb,Pr as oE,Qr as sm,S as Db,St as Pi,Ti as G,Tn as cg,V as Gh,Vn as fg,Vr as pm,W as Hb,Wt as Th,Yn as gl$1,Yt as U1,_t as Ow,ai as ue,ar as hw,br as kw,bt as Pb,c as Ah,di as vw,ei as ti$1,en as Vw,fi as wb,fr as jw,ft as O1,gi as x,gn as _h,ht as Oh,i as $e,ii as ub,j as F1,ji as M,jn as ds,kn as dg,m as Bh,mt as Ob,nn as W1,o as Ab,on as Xi$1,or as iI,pr as k1,qr as ql,qt as Tw,u as Aw,ur as jD,vi as yw,vn as bb,w as Du,wi as F,xt as Ph,yt as PD,z as GD}from"./chunk-LD3k3Loy.js";var Dt=`
2
+ .p-popover {
3
+ margin-block-start: dt('popover.gutter');
4
+ background: dt('popover.background');
5
+ color: dt('popover.color');
6
+ border: 1px solid dt('popover.border.color');
7
+ border-radius: dt('popover.border.radius');
8
+ box-shadow: dt('popover.shadow');
9
+ will-change: transform;
10
+ }
11
+
12
+ .p-popover-content {
13
+ padding: dt('popover.content.padding');
14
+ }
15
+
16
+ .p-popover-flipped {
17
+ margin-block-start: calc(dt('popover.gutter') * -1);
18
+ margin-block-end: dt('popover.gutter');
19
+ }
20
+
21
+ .p-popover:after,
22
+ .p-popover:before {
23
+ bottom: 100%;
24
+ left: calc(dt('popover.arrow.offset') + dt('popover.arrow.left', '0px'));
25
+ content: ' ';
26
+ height: 0;
27
+ width: 0;
28
+ position: absolute;
29
+ pointer-events: none;
30
+ }
31
+
32
+ .p-popover:after {
33
+ border-width: calc(dt('popover.gutter') - 2px);
34
+ margin-left: calc(-1 * (dt('popover.gutter') - 2px));
35
+ border-style: solid;
36
+ border-color: transparent;
37
+ border-bottom-color: dt('popover.background');
38
+ }
39
+
40
+ .p-popover:before {
41
+ border-width: dt('popover.gutter');
42
+ margin-left: calc(-1 * dt('popover.gutter'));
43
+ border-style: solid;
44
+ border-color: transparent;
45
+ border-bottom-color: dt('popover.border.color');
46
+ }
47
+
48
+ .p-popover-flipped:after,
49
+ .p-popover-flipped:before {
50
+ bottom: auto;
51
+ top: 100%;
52
+ }
53
+
54
+ .p-popover.p-popover-flipped:after {
55
+ border-bottom-color: transparent;
56
+ border-top-color: dt('popover.background');
57
+ }
58
+
59
+ .p-popover.p-popover-flipped:before {
60
+ border-bottom-color: transparent;
61
+ border-top-color: dt('popover.border.color');
62
+ }
63
+ `;var Ht={root:({instance:i})=>F({position:`absolute`},i.style())};var Bt={root:`p-popover p-component`,content:`p-popover-content`};var Et=class Z extends fe{name=`popover`;style=Dt;classes=Bt;inlineStyles=Ht;static ɵfac=(()=>{let e;return function(r){return(e||(e=ov(Z)))(r||Z)}})();static ɵprov=ue({token:Z,factory:Z.ɵfac})};var Nt=new x(`POPOVER_INSTANCE`);var At=class j extends ct{componentName=`Popover`;$pcPopover=E(Nt,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=E(Ze,{self:!0});ariaLabel=k1();ariaLabelledBy=k1();dismissable=k1(!0,{transform:U1});style=k1();styleClass=k1();appendTo=k1(`body`);autoZIndex=k1(!0,{transform:U1});ariaCloseLabel=k1();baseZIndex=k1(0,{transform:W1});focusOnShow=k1(!0,{transform:U1});motionOptions=k1(void 0);computedMotionOptions=Hb(()=>F(F({},this.ptm(`motion`)),this.motionOptions()));onShow=O1();onHide=O1();$appendTo=Hb(()=>this.appendTo()||this.config.overlayAppendTo());container;overlayVisible=ti$1(!1);render=ti$1(!1);selfClick=!1;documentClickListener;target=null;willHide;scrollHandler;documentResizeListener;contentTemplate=F1(`content`,{descendants:!1});onCloseClickCallback=this.onCloseClick.bind(this);contentTemplateContext=Hb(()=>({closeCallback:this.onCloseClickCallback}));destroyCallback;overlayEventListener;overlaySubscription;_componentStyle=E(Et);overlayService=E(Wl);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm(`host`))}bindDocumentClickListener(){if(sc(this.platformId)&&!this.documentClickListener){let e=Tl()?`touchstart`:`click`,t=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentClickListener=this.renderer.listen(t,e,r=>{if(!this.dismissable())return;let a=gd(r,this.container),h=gd(r,this.target);!this.container?.contains(a)&&this.target!==h&&!this.target?.contains(h)&&!this.selfClick&&this.hide(),this.selfClick=!1})}}unbindDocumentClickListener(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null,this.selfClick=!1)}toggle(e,t){this.overlayVisible()?(this.hasTargetChanged(e,t)&&(this.destroyCallback=()=>{this.show(null,t||e.currentTarget||e.target)}),this.hide()):this.show(e,t)}show(e,t){t&&e&&e.stopPropagation(),this.container&&!this.overlayVisible()&&(this.container=null),this.target=t||e.currentTarget||e.target,this.overlayVisible.set(!0),this.render.set(!0)}onOverlayClick(e){this.overlayService.add({originalEvent:e,target:this.el.nativeElement}),this.selfClick=!0}onContentClick(e){let t=e.target;this.selfClick=e.offsetX<t.clientWidth&&e.offsetY<t.clientHeight}hasTargetChanged(e,t){return this.target!=null&&this.target!==(t||e.currentTarget||e.target)}appendOverlay(){this.$appendTo()&&this.$appendTo()!==`self`&&(this.$appendTo()===`body`?fl(this.$overlayParent(this.document.body,this.container),this.container):fl(this.$overlayParent(this.$appendTo(),this.container),this.container))}restoreAppend(){this.container&&this.$appendTo()&&this.$appendTo()!==`self`&&fl(this.el.nativeElement,this.container)}setZIndex(){this.autoZIndex()&&Ac.set(`overlay`,this.container,this.baseZIndex()+this.config.zIndex.overlay)}align(){if(this.target&&this.container){dl(this.container,this.target,!1);let e=Ji(this.container),t=Ji(this.target),r=e.left,a=e.top,h=t.left,m=t.top,f=this.document.defaultView?.getComputedStyle(this.container).getPropertyValue(`border-radius`),l=0;r<h&&(l=h-r-parseFloat(f)*2),this.container.style.setProperty(this.$styleScope.resolvers.$dt(`popover.arrow.left`).name,`${l}px`),a<m&&(this.container.setAttribute(`data-p-popover-flipped`,`true`),this.$unstyled()||ze(this.container,this.pcn(`p-popover-flipped`)))}}onAnimationStart(e){this.container=e.element,this.$markInstance(this.container),this.appendOverlay(),this.align(),this.setZIndex(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),this.focusOnShow()&&this.focus(),this.overlayEventListener=t=>{this.container&&this.container.contains(t.target)&&(this.selfClick=!0)},this.overlaySubscription=this.overlayService.clickObservable.subscribe(this.overlayEventListener),this.onShow.emit(null)}onAnimationEnd(){this.overlayVisible()||(this.destroyCallback&&(this.destroyCallback(),this.destroyCallback=null),this.overlaySubscription&&this.overlaySubscription.unsubscribe(),this.autoZIndex()&&Ac.clear(this.container),this.onContainerDestroy(),this.onHide.emit({}),this.render.set(!1),this.container=null)}focus(){let e=gl(this.container,`[autofocus]`);e&&setTimeout(()=>e.focus(),5)}hide(){this.overlayVisible.set(!1)}onCloseClick(e){this.hide(),e.preventDefault()}onEscapeKeydown(e){this.hide()}onWindowResize(){this.overlayVisible()&&!Ol()&&this.hide()}bindDocumentResizeListener(){if(sc(this.platformId)&&!this.documentResizeListener){let e=this.document.defaultView;this.documentResizeListener=this.renderer.listen(e,`resize`,this.onWindowResize.bind(this))}}unbindDocumentResizeListener(){this.documentResizeListener&&(this.documentResizeListener(),this.documentResizeListener=null)}bindScrollListener(){sc(this.platformId)&&(this.scrollHandler||(this.scrollHandler=new hd(this.target,()=>{this.overlayVisible()&&this.hide()})),this.scrollHandler.bindScrollListener())}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}onContainerDestroy(){this.cd.destroyed||(this.target=null),this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}onDestroy(){this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.container&&this.autoZIndex()&&Ac.clear(this.container),this.cd.destroyed||(this.target=null),this.destroyCallback=null,this.container&&(this.restoreAppend(),this.onContainerDestroy()),this.overlaySubscription&&this.overlaySubscription.unsubscribe()}static ɵfac=(()=>{let e;return function(r){return(e||(e=ov(j)))(r||j)}})();static ɵcmp=(function(){let e=[`content`],t=[`*`];function r(m,f){m&1&&Ph(0)}function a(m,f){if(m&1&&_h(0,r,1,0,`ng-container`,3),m&2){let l=Aw(2);Rh(`ngTemplateOutlet`,l.contentTemplate())(`ngTemplateOutletContext`,l.contentTemplateContext())}}function h(m,f){if(m&1){let l=Tw();Pi(0,`div`,1),Bh(`click`,function(g){Gu(l);let D=Aw();return zu(D.onOverlayClick(g))})(`pMotionOnEnter`,function(g){Gu(l);let D=Aw();return zu(D.onAnimationStart(g))})(`pMotionOnAfterLeave`,function(){Gu(l);let g=Aw();return zu(g.onAnimationEnd())}),Pi(1,`div`,2),Bh(`click`,function(g){Gu(l);let D=Aw();return zu(D.onContentClick(g))})(`mousedown`,function(g){Gu(l);let D=Aw();return zu(D.onContentClick(g))}),kw(2),fw(3,a,1,2,`ng-container`),fl$1()()}if(m&2){let l=Aw();Jw(l.sx(`root`)),eb(l.cn(l.cx(`root`),l.styleClass())),Rh(`pBind`,l.ptm(`root`))(`pMotion`,l.overlayVisible())(`pMotionName`,l.pcn(`p-anchored-overlay`))(`pMotionAppear`,!0)(`pMotionOptions`,l.computedMotionOptions()),Ah(`aria-modal`,l.overlayVisible())(`aria-label`,l.ariaLabel())(`aria-labelledBy`,l.ariaLabelledBy()),iI(),eb(l.cx(`content`)),Rh(`pBind`,l.ptm(`content`)),iI(2),hw(l.contentTemplate()?3:-1)}}return PD({type:j,selectors:[[`p-popover`]],contentQueries:function(f,l,M){f&1&&Gh(M,l.contentTemplate,e,4),f&2&&jw()},hostBindings:function(f,l){f&1&&Bh(`keydown.escape`,function(g){return l.onEscapeKeydown(g)},oE)},inputs:{ariaLabel:[1,`ariaLabel`],ariaLabelledBy:[1,`ariaLabelledBy`],dismissable:[1,`dismissable`],style:[1,`style`],styleClass:[1,`styleClass`],appendTo:[1,`appendTo`],autoZIndex:[1,`autoZIndex`],ariaCloseLabel:[1,`ariaCloseLabel`],baseZIndex:[1,`baseZIndex`],focusOnShow:[1,`focusOnShow`],motionOptions:[1,`motionOptions`]},outputs:{onShow:`onShow`,onHide:`onHide`},features:[Db([Et,{provide:Nt,useExisting:j},{provide:At$1,useExisting:j}]),GD([Ze]),Th],ngContentSelectors:t,decls:1,vars:1,consts:[[`role`,`dialog`,3,`pBind`,`class`,`style`,`pMotion`,`pMotionName`,`pMotionAppear`,`pMotionOptions`],[`role`,`dialog`,3,`click`,`pMotionOnEnter`,`pMotionOnAfterLeave`,`pBind`,`pMotion`,`pMotionName`,`pMotionAppear`,`pMotionOptions`],[3,`click`,`mousedown`,`pBind`],[4,`ngTemplateOutlet`,`ngTemplateOutletContext`]],template:function(f,l){f&1&&(Ow(),fw(0,h,4,16,`div`,0)),f&2&&hw(l.render()?0:-1)},dependencies:[xs,yi,Ze,Su,vu],encapsulation:2})})()};var Ot=class ke{static ɵfac=function(t){return new(t||ke)};static ɵmod=jD({type:ke});static ɵinj=Du({imports:[At,yi,yi]})};var Vt=(i,u,e=0)=>{let t=10**e,r=i*t,a;switch(u){case`floor`:a=Math.floor(r);break;case`ceil`:a=Math.ceil(r);break;default:a=Math.round(r)}return a/t};var ve=(i,u=96,e=`ceil`,t=0)=>{return Vt(i*37.7952755906,e,t)};var z=(i,u=96,e=`ceil`,t=0)=>{return Vt(i*.0264583333,e,t)};var Lt=(()=>{class i{constructor(){this.form=k1(),this.onSubmit=O1()}onSubmitHandler(){this.onSubmit.emit(this.form().getRawValue())}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=PD({type:i,selectors:[[`app-dialog-form-create`]],inputs:{form:[1,`form`]},outputs:{onSubmit:`onSubmit`},decls:57,vars:7,consts:[[1,`row`,`row-gap-2`,3,`formGroup`],[1,`col-12`],[1,`form-group`],[`for`,``,1,`fs-3`,`fw-semibold`],[`formControlName`,`name`,`type`,`text`,`pInputText`,``,1,`form-control`],[1,`col-6`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`paperWidthCM`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`paperWidth`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerWidthCM`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerWidth`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerHeightCM`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerHeight`,`pInputText`,``,3,`precision`]],template:function(t,r){t&1&&(Pi(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`label`,3),ub(4,`Label Name`),fl$1(),Pi(5,`input`,4),GI(),fl$1()()(),Pi(6,`div`,5)(7,`div`,2)(8,`label`,3),ub(9,`Paper Width`),fl$1(),Pi(10,`p-inputgroup`)(11,`input`,6),GI(),fl$1(),Pi(12,`p-inputgroup-addon`)(13,`span`),ub(14,`cm`),fl$1()()()()(),Pi(15,`div`,5)(16,`div`,2),Oh(17,`label`,3),Pi(18,`p-inputgroup`)(19,`input`,7),GI(),fl$1(),Pi(20,`p-inputgroup-addon`)(21,`span`),ub(22,`px`),fl$1()()()()(),Pi(23,`div`,5)(24,`div`,2)(25,`label`,3),ub(26,`Sticker Width`),fl$1(),Pi(27,`p-inputgroup`)(28,`input`,8),GI(),fl$1(),Pi(29,`p-inputgroup-addon`)(30,`span`),ub(31,`cm`),fl$1()()()()(),Pi(32,`div`,5)(33,`div`,2),Oh(34,`label`,3),Pi(35,`p-inputgroup`)(36,`input`,9),GI(),fl$1(),Pi(37,`p-inputgroup-addon`)(38,`span`),ub(39,`px`),fl$1()()()()(),Pi(40,`div`,5)(41,`div`,2)(42,`label`,3),ub(43,`Sticker Height`),fl$1(),Pi(44,`p-inputgroup`)(45,`input`,10),GI(),fl$1(),Pi(46,`p-inputgroup-addon`)(47,`span`),ub(48,`cm`),fl$1()()()()(),Pi(49,`div`,5)(50,`div`,2),Oh(51,`label`,3),Pi(52,`p-inputgroup`)(53,`input`,11),GI(),fl$1(),Pi(54,`p-inputgroup-addon`)(55,`span`),ub(56,`px`),fl$1()()()()()()),t&2&&(Rh(`formGroup`,r.form()),iI(5),QI(),iI(6),Rh(`precision`,2),QI(),iI(8),Rh(`precision`,2),QI(),iI(9),Rh(`precision`,2),QI(),iI(8),Rh(`precision`,2),QI(),iI(9),Rh(`precision`,2),QI(),iI(8),Rh(`precision`,2),QI())},dependencies:[fh,Fo,oh,sh,vl,Tl$1,$n,Gn,Sn,Ul],encapsulation:2,changeDetection:1})}}return i})();var Ft=(()=>{class i{constructor(){this.form=k1(),this.onSubmit=O1()}onSubmitHandler(){this.onSubmit.emit(this.form().getRawValue())}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=PD({type:i,selectors:[[`app-dialog-form-edit`]],inputs:{form:[1,`form`]},outputs:{onSubmit:`onSubmit`},decls:57,vars:7,consts:[[1,`row`,`row-gap-2`,3,`formGroup`],[1,`col-12`],[1,`form-group`],[`for`,``,1,`fs-3`,`fw-semibold`],[`formControlName`,`name`,`type`,`text`,`pInputText`,``,1,`form-control`],[1,`col-6`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`paperWidthCM`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`paperWidth`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerWidthCM`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerWidth`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerHeightCM`,`pInputText`,``,3,`precision`],[`appMaskNumber`,``,`postfix`,``,`formControlName`,`stickerHeight`,`pInputText`,``,3,`precision`]],template:function(t,r){t&1&&(Pi(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`label`,3),ub(4,`Label Name`),fl$1(),Pi(5,`input`,4),GI(),fl$1()()(),Pi(6,`div`,5)(7,`div`,2)(8,`label`,3),ub(9,`Paper Width`),fl$1(),Pi(10,`p-inputgroup`)(11,`input`,6),GI(),fl$1(),Pi(12,`p-inputgroup-addon`)(13,`span`),ub(14,`cm`),fl$1()()()()(),Pi(15,`div`,5)(16,`div`,2),Oh(17,`label`,3),Pi(18,`p-inputgroup`)(19,`input`,7),GI(),fl$1(),Pi(20,`p-inputgroup-addon`)(21,`span`),ub(22,`px`),fl$1()()()()(),Pi(23,`div`,5)(24,`div`,2)(25,`label`,3),ub(26,`Sticker Width`),fl$1(),Pi(27,`p-inputgroup`)(28,`input`,8),GI(),fl$1(),Pi(29,`p-inputgroup-addon`)(30,`span`),ub(31,`cm`),fl$1()()()()(),Pi(32,`div`,5)(33,`div`,2),Oh(34,`label`,3),Pi(35,`p-inputgroup`)(36,`input`,9),GI(),fl$1(),Pi(37,`p-inputgroup-addon`)(38,`span`),ub(39,`px`),fl$1()()()()(),Pi(40,`div`,5)(41,`div`,2)(42,`label`,3),ub(43,`Sticker Height`),fl$1(),Pi(44,`p-inputgroup`)(45,`input`,10),GI(),fl$1(),Pi(46,`p-inputgroup-addon`)(47,`span`),ub(48,`cm`),fl$1()()()()(),Pi(49,`div`,5)(50,`div`,2),Oh(51,`label`,3),Pi(52,`p-inputgroup`)(53,`input`,11),GI(),fl$1(),Pi(54,`p-inputgroup-addon`)(55,`span`),ub(56,`px`),fl$1()()()()()()),t&2&&(Rh(`formGroup`,r.form()),iI(5),QI(),iI(6),Rh(`precision`,2),QI(),iI(8),Rh(`precision`,2),QI(),iI(9),Rh(`precision`,2),QI(),iI(8),Rh(`precision`,2),QI(),iI(9),Rh(`precision`,2),QI(),iI(8),Rh(`precision`,2),QI())},dependencies:[fh,Fo,oh,sh,vl,Tl$1,Sn,$n,Gn,Ul],encapsulation:2,changeDetection:1})}}return i})();var jt=()=>({width:`35rem`});var $t=i=>({"border border-primary":i});var qt=()=>({class:`py-1`});var Zt=i=>({root:i});var zt=(i,u)=>u.ID;function Gt(i,u){if(i&1){let e=Tw();Pi(0,`div`,8)(1,`p-button`,9),Bh(`click`,function(){Gu(e);let r=Aw();return zu(r.openCreate())}),fl$1()()}if(i&2){let e=Aw();iI(),Rh(`disabled`,!e.isUserAdmin)}}function Ut(i,u){if(i&1){let e=Tw();Pi(0,`input`,22),Bh(`change`,function(){Gu(e);let r=Aw(2).$implicit,a=Aw(2);return zu(a.onSelectionChange(r.ID))}),fl$1()}if(i&2){let e=Aw(2).$implicit,t=Aw(2);Rh(`value`,e.ID)(`checked`,t.selectedTemplateId()===e.ID)}}function Kt(i,u){if(i&1&&(Pi(0,`div`,19)(1,`div`,20)(2,`span`),ub(3),fl$1()(),Pi(4,`div`,16),fw(5,Ut,1,2,`input`,21),fl$1()()),i&2){let e=Aw().$implicit,t=Aw(2);iI(3),cg(e.ConfigObject.Name),iI(2),hw(t.selectedTemplateId()===e.ID?5:-1)}}function Jt(i,u){if(i&1&&(gl$1(0),Pi(1,`span`),ub(2),Ab(3,`number`),fl$1(),Pi(4,`span`),ub(5,`/`),fl$1(),Xi$1()),i&2){let e=Aw().$implicit;iI(2),ml(``,Ob(3,1,e.ConfigObject.PaperWidthCM),`cm`)}}function Qt(i,u){if(i&1&&(gl$1(0),Pi(1,`span`),ub(2),Ab(3,`number`),fl$1(),Pi(4,`span`),ub(5,`/`),fl$1(),Xi$1()),i&2){let e=Aw().$implicit;iI(2),ml(``,Ob(3,1,e.ConfigObject.StickerWidthCM),`cm`)}}function Xt(i,u){if(i&1&&(gl$1(0),Pi(1,`span`),ub(2),Ab(3,`number`),fl$1(),Pi(4,`span`),ub(5,`/`),fl$1(),Xi$1()),i&2){let e=Aw().$implicit;iI(2),ml(``,Ob(3,1,e.ConfigObject.StickerHeightCM),`cm`)}}function Yt(i,u){if(i&1){let e=Tw();Pi(0,`div`,23)(1,`p-button`,24),Bh(`onClick`,function(r){Gu(e);let a=Vw(3),h=Aw().$implicit,m=Aw(2);return zu(m.onMenuToggle(r,a,h.ID))}),fl$1(),Oh(2,`p-menu`,25,4),fl$1()}if(i&2){let e=Aw(3);iI(),Rh(`outlined`,!0)(`pt`,bb(5,Zt,wb(4,qt))),iI(),Rh(`model`,e.menuItems())(`popup`,!0)}}function ei(i,u){if(i&1){let e=Tw();Pi(0,`div`,12)(1,`p-card`,13),Bh(`click`,function(){let r=Gu(e).$implicit,a=Aw(2);return zu(a.onSelectionChange(r.ID))}),_h(2,Kt,6,2,`ng-template`,null,3,Pb),Pi(4,`div`,14)(5,`div`,15),ub(6,`Paper Width`),fl$1(),Pi(7,`div`,16)(8,`div`,17),_h(9,Jt,6,3,`ng-container`,18),Pi(10,`span`),ub(11),Ab(12,`number`),fl$1()()()(),Pi(13,`div`,14)(14,`div`,15),ub(15,`Sticker Width`),fl$1(),Pi(16,`div`,16)(17,`div`,17),_h(18,Qt,6,3,`ng-container`,18),Pi(19,`span`),ub(20),Ab(21,`number`),fl$1()()()(),Pi(22,`div`,14)(23,`div`,15),ub(24,`Sticker Height`),fl$1(),Pi(25,`div`,16)(26,`div`,17),_h(27,Xt,6,3,`ng-container`,18),Pi(28,`span`),ub(29),Ab(30,`number`),fl$1()()()(),_h(31,Yt,4,7,`ng-template`,null,2,Pb),fl$1()()}if(i&2){let e=u.$implicit,t=Aw(2);iI(),Rh(`ngClass`,bb(13,$t,t.selectedTemplateId()===e.ID)),iI(8),Rh(`ngIf`,e.ConfigObject.PaperWidthCM),iI(2),ml(``,Ob(12,7,e.ConfigObject.PaperWidth),`px`),iI(7),Rh(`ngIf`,e.ConfigObject.StickerWidthCM),iI(2),ml(``,Ob(21,9,e.ConfigObject.StickerWidth),`px`),iI(7),Rh(`ngIf`,e.ConfigObject.StickerHeightCM),iI(2),ml(``,Ob(30,11,e.ConfigObject.StickerHeight),`px`)}}function ti(i,u){if(i&1&&(Pi(0,`p-card`,10)(1,`div`,11),yw(2,ei,33,15,`div`,12,zt),fl$1()()),i&2){let e=Aw();iI(2),vw(e.profileTemplates())}}function ii(i,u){if(i&1){let e=Tw();Pi(0,`div`,26)(1,`p-button`,27),Bh(`onClick`,function(){Gu(e);let r=Aw();return zu(r.onNextStep())}),fl$1()()}if(i&2){let e=Aw();iI(),Rh(`disabled`,!e.hasSelectedTemplate())}}function oi(i,u){if(i&1){let e=Tw();Pi(0,`app-dialog-form-edit`,28),Bh(`onSubmit`,function(r){Gu(e);let a=Aw();return zu(a.onDialogFormEdit(r))}),fl$1()}if(i&2){let e=Aw();Rh(`form`,e.form)}}function ni(i,u){if(i&1){let e=Tw();Pi(0,`app-dialog-form-create`,28),Bh(`onSubmit`,function(r){Gu(e);let a=Aw();return zu(a.onDialogFormCreate(r))}),fl$1()}if(i&2){let e=Aw();Rh(`form`,e.form)}}function ri(i,u){if(i&1){let e=Tw();Pi(0,`p-button`,29),Bh(`onClick`,function(){Gu(e);let r=Aw();return zu(r.closeDialog())}),fl$1(),Pi(1,`p-button`,30),Bh(`onClick`,function(){Gu(e);let r=Aw();return zu(r.onSubmit())}),fl$1()}}var Wt=(()=>{class i$1{constructor(){this.templateService=E(Rg),this.appStore=E(eu),this.profileTemplates=ti$1(null),this.fb=E(dh),this.router=E(W),this.route=E(Z),this.selectedTemplateId=ti$1(null),this.profileTemplateDefault=ti$1(null),this.dialogVisible=ti$1(!1),this.dialogMode=ti$1(null),this.menuItems=ti$1([]),this.isPatching=ti$1(!1),this.isFirstRun=!0,this.hasSelectedTemplate=Hb(()=>this.selectedTemplateId()!=null)}get isUserAdmin(){return this.appStore.userRole()===`admin`}initDialogState(){this.route.queryParamMap.pipe(ql(e=>{let t=e.get(`dialog`),r=e.get(`id`);if(t===`create`){this.dialogMode.update(a=>`create`),this.dialogVisible.update(a=>!0),this.selectedTemplateId.update(a=>null),this.form.reset();return}if(t===`edit`&&r){this.dialogMode.update(a=>`edit`),this.dialogVisible.update(a=>!0),this.selectedTemplateId.update(a=>r),this.handleTemplateEdit(r);return}this.dialogVisible.update(a=>!1),this.dialogMode.update(a=>null),this.selectedTemplateId.update(a=>null)})).subscribe()}ngOnInit(){this.closeDialog(),this.initForm(),this.loadData(),this.initMenuItems(),this.initDialogState(),this.templateService.getDefaultPaperTemplate().pipe(i(`Default template loaded`),ql(e=>this.profileTemplateDefault.update(t=>e))).subscribe(),this.linkControls(this.form.controls.paperWidth,this.form.controls.paperWidthCM,e=>z(e,96,`round`,2),e=>ve(e,96,`round`,2)),this.linkControls(this.form.controls.stickerWidth,this.form.controls.stickerWidthCM,e=>z(e,96,`round`,2),e=>ve(e,96,`round`,2)),this.linkControls(this.form.controls.stickerHeight,this.form.controls.stickerHeightCM,e=>z(e,96,`round`,2),e=>ve(e,96,`round`,2))}ngAfterViewInit(){let e=localStorage.getItem(Xt$1.SelectedProfileTemplate);if(e)try{let t=JSON.parse(e);t?.ID!=null&&(this.selectedTemplateId.set(t.ID),this.appStore.updateProfileTemplate(t))}catch(t){console.warn(`Failed to parse selected profile template from localStorage`,t),localStorage.removeItem(Xt$1.SelectedProfileTemplate)}}onDialogFormEdit(e){Object.assign(this.form.value,e)}onDialogFormCreate(e){Object.assign(this.form.value,e)}initMenuItems(){this.menuItems.update(e=>[...e,{label:`Edit`,disabled:!this.isUserAdmin,command:t=>{this.openEdit(t.item.id)}},{label:`Copy`,disabled:!this.isUserAdmin,command:t=>{this.onCopyTemplate(t.item.id)}},{label:`Delete`,disabled:!this.isUserAdmin,command:t=>{this.onDeleteTemplate(t.item.id)}}])}handleTemplateEdit(e){this.templateService.getPaperTemplatesById(e).pipe(ql(({ConfigObject:{Name:t,PaperWidth:r,PaperWidthCM:a,StickerWidth:h,StickerWidthCM:m,StickerHeight:f,StickerHeightCM:l}})=>{this.isPatching.update(g=>!0);let M=(g,D)=>g||(D?z(D,96,`round`,2):g);this.form.patchValue({name:t,paperWidth:r,paperWidthCM:M(a,r),stickerWidth:h,stickerWidthCM:M(m,h),stickerHeight:f,stickerHeightCM:M(l,f)}),this.isPatching.update(g=>!1)})).subscribe()}linkControls(e,t,r,a){let h=(m,f=2)=>m.toFixed(f);e.valueChanges.pipe(sm(),$e(()=>!this.isPatching()),ql(m=>{if(m!=null){let f=r(m);t.setValue(h(f),{emitEvent:!1})}})).subscribe(),t.valueChanges.pipe(sm(),$e(()=>!this.isPatching()),ql(m=>{if(m!=null){let f=a(m);e.setValue(h(f),{emitEvent:!1})}})).subscribe()}loadData(){let e=`https://${localStorage.getItem(Xt$1.Host)}/`;pm({templates:this.templateService.getBarcodeTemplate().pipe(fs(t=>(console.error(`Failed to load templates:`,t),ds([])))),outlets:this.templateService.getListOutlet(e).pipe(fs(t=>(console.error(`Failed to load outlets:`,t),ds([])))),taxes:this.templateService.getListTax(e).pipe(fs(t=>(console.error(`Failed to load taxes:`,t),ds([]))))}).pipe(ql(({templates:t,outlets:r,taxes:a})=>{this.appStore.updateOutlets(r),this.appStore.updateTaxes(a),this.profileTemplates.set(t)}),i(`All template data loaded (even if some failed)`)).subscribe()}onMenuToggle(e,t,r){e.stopPropagation(),t.toggle(e),this.menuItems().forEach(a=>a.id=r)}initForm(){this.form=this.fb.group({paperWidthCM:void 0,name:this.fb.control(null),paperWidth:this.fb.control(null),stickerWidth:this.fb.control(null),stickerWidthCM:this.fb.control(null),stickerHeight:this.fb.control(null),stickerHeightCM:this.fb.control(null)})}onSelectionChange(e){return M(this,null,function*(){this.selectedTemplateId.update(t=>e)})}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{name:e,paperWidth:t,paperWidthCM:r,stickerWidth:a,stickerWidthCM:h,stickerHeight:m,stickerHeightCM:f}=this.form.value;if(this.route.snapshot.queryParamMap.has(`id`)){let l=this.profileTemplates().findIndex(g=>g.ID===this.route.snapshot.queryParamMap.get(`id`));if(l===-1)return;let M$1=G(F({},this.profileTemplates()[l]),{ConfigObject:G(F({},this.profileTemplates()[l].ConfigObject),{Name:e,PaperWidth:+t,PaperWidthCM:+r,StickerWidth:+a,StickerWidthCM:+h,StickerHeight:+m,StickerHeightCM:+f})});this.templateService.updatePaperTemplate(this.route.snapshot.queryParamMap.get(`id`),M$1).pipe(ql(()=>M(this,null,function*(){this.loadData(),this.closeDialog()}))).subscribe()}else{let l={ConfigObject:G(F({},this.profileTemplateDefault()),{Name:e,PaperWidth:+t,PaperWidthCM:+r,StickerWidth:+a,StickerWidthCM:+h,StickerHeight:+m,StickerHeightCM:+f})};this.templateService.savePaperTemplate(l).pipe(i(`Template saved`),ql(()=>M(this,null,function*(){this.loadData(),this.closeDialog()}))).subscribe()}}openCreate(){this.router.navigate([],{queryParams:{dialog:`create`},queryParamsHandling:`merge`})}openEdit(e){this.router.navigate([],{queryParams:{dialog:`edit`,id:e},queryParamsHandling:`merge`})}closeDialog(){this.router.navigate([],{queryParams:{},replaceUrl:!0})}onDeleteTemplate(e){this.templateService.deletePaperTemplate(e).pipe(ql(()=>{this.loadData()})).subscribe(),setTimeout(()=>{document.querySelector(`.p-menu-overlay`)?.remove()},100)}onCopyTemplate(e){this.templateService.copyPaperTemplate(e).pipe(ql(()=>{this.loadData()})).subscribe(),setTimeout(()=>{document.querySelector(`.p-menu-overlay`)?.remove()},100)}onPreviousStep(){this.appStore.updateCurrentStep(this.appStore.currentStep()-1)}onNextStep(){this.appStore.updateCurrentStep(this.appStore.currentStep()+1);let e=this.profileTemplates().find(t=>t.ID===this.selectedTemplateId());this.appStore.updateProfileTemplate(e),localStorage.setItem(Xt$1.SelectedProfileTemplate,JSON.stringify(e))}static{this.ɵfac=function(t){return new(t||i$1)}}static{this.ɵcmp=PD({type:i$1,selectors:[[`app-choose-profile-template`]],decls:12,vars:9,consts:[[`actionButton`,``],[`content`,``],[`footer`,``],[`title`,``],[`menu`,``],[`pageTitle`,`Choose Paper Template`],[`appendTo`,`body`,3,`visibleChange`,`closable`,`header`,`modal`,`visible`],[3,`form`],[1,`d-flex`,`gap-2`,`justify-content-end`,`align-items-center`],[`label`,`Add`,3,`click`,`disabled`],[1,`p-2`,`m-3`],[1,`row`,`row-gap-4`],[1,`col-12`,`col-md-6`,`col-lg-4`,`col-xl-3`],[3,`click`,`ngClass`],[1,`row`,`fs-3`],[1,`col`],[1,`col`,`d-flex`,`justify-content-end`],[1,`d-flex`,`gap-2`],[4,`ngIf`],[1,`row`],[1,`col-10`],[`type`,`radio`,`name`,`selectedCategory`,1,`p-radiobutton-box`,3,`value`,`checked`],[`type`,`radio`,`name`,`selectedCategory`,1,`p-radiobutton-box`,3,`change`,`value`,`checked`],[1,`d-flex`,`justify-content-end`,`border-top`,`py-2`],[`icon`,`fa-solid fa-ellipsis`,`severity`,`secondary`,3,`onClick`,`outlined`,`pt`],[`appendTo`,`body`,3,`model`,`popup`],[1,`d-flex`,`justify-content-end`,`gap-2`,`py-2`,`px-3`],[`label`,`Next`,`severity`,`info`,3,`onClick`,`disabled`],[3,`onSubmit`,`form`],[`label`,`Cancel`,`severity`,`secondary`,3,`onClick`],[`label`,`Save`,`severity`,`secondary`,3,`onClick`]],template:function(t,r){if(t&1){let a=Tw();Pi(0,`app-main-panel`,5),_h(1,Gt,2,1,`ng-template`,null,0,Pb)(3,ti,4,0,`ng-template`,null,1,Pb)(5,ii,2,1,`ng-template`,null,2,Pb),fl$1(),Pi(7,`p-dialog`,6),fg(`visibleChange`,function(m){return Gu(a),hb(r.dialogVisible,m)||(r.dialogVisible=m),zu(m)}),fw(8,oi,1,1,`app-dialog-form-edit`,7),fw(9,ni,1,1,`app-dialog-form-create`,7),_h(10,ri,2,0,`ng-template`,null,2,Pb),fl$1()}t&2&&(iI(7),Jw(wb(8,jt)),Rh(`closable`,!1)(`header`,r.dialogMode()==`create`?`Create New Label`:`Edit New Label`)(`modal`,!0),dg(`visible`,r.dialogVisible),iI(),hw(r.dialogMode()==`edit`?8:-1),iI(),hw(r.dialogMode()==`create`?9:-1))},dependencies:[gr,fh,D,Xi,Fs,Ns,Hl,Ee,Ot,An,In,hh,Lt,Ft,Us],styles:[`[_nghost-%COMP%]{display:block;height:100%}input[type=radio][_ngcontent-%COMP%]{appearance:none;width:18px;height:18px;border:2px solid #ced4da;border-radius:50%;outline:none;cursor:pointer;position:relative}input[type=radio][_ngcontent-%COMP%]:checked{border-color:#3b82f6}input[type=radio][_ngcontent-%COMP%]:checked:after{content:"";position:absolute;top:50%;left:50%;width:8px;height:8px;background:#3b82f6;border-radius:50%;transform:translate(-50%,-50%)}`]})}}return i$1})();function ai(i,u){i&1&&Oh(0,`app-choose-profile-template`)}function li(i,u){i&1&&Oh(0,`choose-product`)}function pi(i,u){if(i&1&&Oh(0,`app-barcode-preview`,1),i&2){let e=u.$implicit;Rh(`cartItems`,e)}}function si(i,u){i&1&&(Pi(0,`app-customize-label`),_h(1,pi,1,1,`ng-template`,null,0,Pb),fl$1())}function ci(i,u){i&1&&Oh(0,`app-print-preview`)}var Bo=(()=>{class i{constructor(){this.storeService=E(el),this.appStore=E(eu)}get cartItems(){return this.appStore.flattenedCartUnits()}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=PD({type:i,selectors:[[`app-barcode-wrapper`]],decls:4,vars:1,consts:[[`content`,``],[`previewMode`,`single`,3,`cartItems`]],template:function(t,r){if(t&1&&fw(0,ai,1,0,`app-choose-profile-template`)(1,li,1,0,`choose-product`)(2,si,3,0,`app-customize-label`)(3,ci,1,0,`app-print-preview`),t&2){let a;hw((a=r.appStore.currentStep())===1?0:a===2?1:a===3?2:a===4?3:-1)}},dependencies:[Wt,vz,dj,rd,bV],encapsulation:2,changeDetection:1})}}return i})();export{Bo as BarcodeWrapperComponent};