dealposbarcode 26.47.1 → 26.47.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{_ as W,a as In,b as Z,v as Xt$1,x as eu}from"./main-6DI32WEG.js";import{t as D}from"./chunk-BZI-5oM5.js";import{a as rd,i as lz,n as Q6,o as xV,r as Ul,s as zg,t as Hl}from"./chunk-DzGhjAJh.js";import"./chunk-DM0MYgMF.js";import"./chunk-cD6pvlNi.js";import{t as i}from"./chunk-S3eMZOYS.js";import{_ as zn,d as Vn,f as cr,i as Ee,m as qn,r as Dn}from"./chunk-35bh3Tii.js";import{B as cl,Ct as wt,Et as yc,F as Ze,I as ad,N as Yi,O as Sl,V as ct,Y as hi,_t as uu,at as ol,bt as vl,ct as pu,ht as ue,it as nl,kt as ze,lt as qa,s as Dl,z as cd}from"./chunk-B1TuWbQG.js";import{D as Xi,F as fh,K as oh,P as dh,R as hh,S as Tl,X as sh,Y as sc,a as Fs,h as Ns,i as Fo,ot as xs,tt as vl$1,w as Us}from"./chunk-CmmFAMM4.js";import{$n as gb,At as Qu,Bt as Sw,Ct as Pw,Di as G,Ei as F,Et as Qh,Fn as cv,Gt as UD,Hr as qb,J as K1,Jn as fl,Kr as rb,Kt as Uh,Lr as oj,Ni as M,O as Ew,On as bu,Pn as cm,R as I,Sr as kh,Tt as Q1,Wr as ql,X as KI,Y as KD,Zn as fs,_i as x,_r as jb,ai as ue$1,an as Xi$1,bi as z1,bn as _h,br as jw,bt as Pi,ct as Nb,d as Bb,dr as ib,ei as ti$1,et as Lh,gi as ww,gn as Zu,ht as Oh,ii as uI,in as XI,jr as ml,kn as bw,lt as Nh,n as $e,nr as gl,nt as Mb,oi as ug,or as hg,qr as rj,qt as Uw,rn as Ww,rr as gm,tn as Vw,u as BD,vn as _b,vr as jh,vt as Pb,w as Eb,wr as lE,yi as yw,zn as ds,zr as pg}from"./chunk-rvtowGG1.js";var Dt=`
1
+ import{_ as W,a as In,b as Z,v as Xt$1,x as eu}from"./main-2MSSWA5I.js";import{t as D}from"./chunk-BZI-5oM5.js";import{a as od,i as _V,n as Vl,o as sz,r as Z6,s as zg,t as $l}from"./chunk-GW-GCUof.js";import"./chunk-DM0MYgMF.js";import"./chunk-C3VygkZG.js";import{t as i}from"./chunk-S3eMZOYS.js";import{_ as zn,d as Vn,f as cr,i as Ee,m as qn,r as Dn}from"./chunk-35bh3Tii.js";import{B as cl,Ct as wt,Et as yc,F as Ze,I as ad,N as Yi,O as Sl,V as ct,Y as hi,_t as uu,at as ol,bt as vl,ct as pu,ht as ue,it as nl,kt as ze,lt as qa,s as Dl,z as cd}from"./chunk-B1TuWbQG.js";import{D as Xi,F as fh,K as oh,P as dh,R as hh,S as Tl,X as sh,Y as sc,a as Fs,h as Ns,i as Fo,ot as xs,tt as vl$1,w as Us}from"./chunk-CmmFAMM4.js";import{$n as gb,At as Qu,Bt as Sw,Ct as Pw,Di as G,Ei as F,Et as Qh,Fn as cv,Gt as UD,Hr as qb,J as K1,Jn as fl,Kr as rb,Kt as Uh,Lr as oj,Ni as M,O as Ew,On as bu,Pn as cm,R as I,Sr as kh,Tt as Q1,Wr as ql,X as KI,Y as KD,Zn as fs,_i as x,_r as jb,ai as ue$1,an as Xi$1,bi as z1,bn as _h,br as jw,bt as Pi,ct as Nb,d as Bb,dr as ib,ei as ti$1,et as Lh,gi as ww,gn as Zu,ht as Oh,ii as uI,in as XI,jr as ml,kn as bw,lt as Nh,n as $e,nr as gl,nt as Mb,oi as ug,or as hg,qr as rj,qt as Uw,rn as Ww,rr as gm,tn as Vw,u as BD,vn as _b,vr as jh,vt as Pb,w as Eb,wr as lE,yi as yw,zn as ds,zr as pg}from"./chunk-rvtowGG1.js";var Dt=`
2
2
  .p-popover {
3
3
  margin-block-start: dt('popover.gutter');
4
4
  background: dt('popover.background');
@@ -60,4 +60,4 @@ import{_ as W,a as In,b as Z,v as Xt$1,x as eu}from"./main-6DI32WEG.js";import{t
60
60
  border-bottom-color: transparent;
61
61
  border-top-color: dt('popover.border.color');
62
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 ue{name=`popover`;style=Dt;classes=Bt;inlineStyles=Ht;static ɵfac=(()=>{let e;return function(n){return(e||(e=cv(Z)))(n||Z)}})();static ɵprov=ue$1({token:Z,factory:Z.ɵfac})};var Nt=new x(`POPOVER_INSTANCE`);var At=class j extends ct{componentName=`Popover`;$pcPopover=I(Nt,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=I(Ze,{self:!0});ariaLabel=Q1();ariaLabelledBy=Q1();dismissable=Q1(!0,{transform:rj});style=Q1();styleClass=Q1();appendTo=Q1(`body`);autoZIndex=Q1(!0,{transform:rj});ariaCloseLabel=Q1();baseZIndex=Q1(0,{transform:oj});focusOnShow=Q1(!0,{transform:rj});motionOptions=Q1(void 0);computedMotionOptions=qb(()=>F(F({},this.ptm(`motion`)),this.motionOptions()));onShow=z1();onHide=z1();$appendTo=qb(()=>this.appendTo()||this.config.overlayAppendTo());container;overlayVisible=ti$1(!1);render=ti$1(!1);selfClick=!1;documentClickListener;target=null;willHide;scrollHandler;documentResizeListener;contentTemplate=K1(`content`,{descendants:!1});onCloseClickCallback=this.onCloseClick.bind(this);contentTemplateContext=qb(()=>({closeCallback:this.onCloseClickCallback}));destroyCallback;overlayEventListener;overlaySubscription;_componentStyle=I(Et);overlayService=I(Dl);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm(`host`))}bindDocumentClickListener(){if(sc(this.platformId)&&!this.documentClickListener){let e=vl()?`touchstart`:`click`,t=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentClickListener=this.renderer.listen(t,e,n=>{if(!this.dismissable())return;let a=cd(n,this.container),h=cd(n,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`?ol(this.$overlayParent(this.document.body,this.container),this.container):ol(this.$overlayParent(this.$appendTo(),this.container),this.container))}restoreAppend(){this.container&&this.$appendTo()&&this.$appendTo()!==`self`&&ol(this.el.nativeElement,this.container)}setZIndex(){this.autoZIndex()&&yc.set(`overlay`,this.container,this.baseZIndex()+this.config.zIndex.overlay)}align(){if(this.target&&this.container){nl(this.container,this.target,!1);let e=Yi(this.container),t=Yi(this.target),n=e.left,a=e.top,h=t.left,d=t.top,f=this.document.defaultView?.getComputedStyle(this.container).getPropertyValue(`border-radius`),l=0;n<h&&(l=h-n-parseFloat(f)*2),this.container.style.setProperty(this.$styleScope.resolvers.$dt(`popover.arrow.left`).name,`${l}px`),a<d&&(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()&&yc.clear(this.container),this.onContainerDestroy(),this.onHide.emit({}),this.render.set(!1),this.container=null)}focus(){let e=cl(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()&&!Sl()&&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 ad(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()&&yc.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(n){return(e||(e=cv(j)))(n||j)}})();static ɵcmp=(function(){let e=[`content`],t=[`*`];function n(d,f){d&1&&jh(0)}function a(d,f){if(d&1&&Nh(0,n,1,0,`ng-container`,3),d&2){let l=Pw(2);kh(`ngTemplateOutlet`,l.contentTemplate())(`ngTemplateOutletContext`,l.contentTemplateContext())}}function h(d,f){if(d&1){let l=Sw();Pi(0,`div`,1),Uh(`click`,function(g){Qu(l);let D=Pw();return Zu(D.onOverlayClick(g))})(`pMotionOnEnter`,function(g){Qu(l);let D=Pw();return Zu(D.onAnimationStart(g))})(`pMotionOnAfterLeave`,function(){Qu(l);let g=Pw();return Zu(g.onAnimationEnd())}),Pi(1,`div`,2),Uh(`click`,function(g){Qu(l);let D=Pw();return Zu(D.onContentClick(g))})(`mousedown`,function(g){Qu(l);let D=Pw();return Zu(D.onContentClick(g))}),Vw(2),yw(3,a,1,2,`ng-container`),fl()()}if(d&2){let l=Pw();rb(l.sx(`root`)),ib(l.cn(l.cx(`root`),l.styleClass())),kh(`pBind`,l.ptm(`root`))(`pMotion`,l.overlayVisible())(`pMotionName`,l.pcn(`p-anchored-overlay`))(`pMotionAppear`,!0)(`pMotionOptions`,l.computedMotionOptions()),Oh(`aria-modal`,l.overlayVisible())(`aria-label`,l.ariaLabel())(`aria-labelledBy`,l.ariaLabelledBy()),uI(),ib(l.cx(`content`)),kh(`pBind`,l.ptm(`content`)),uI(2),Ew(l.contentTemplate()?3:-1)}}return BD({type:j,selectors:[[`p-popover`]],contentQueries:function(f,l,M){f&1&&Qh(M,l.contentTemplate,e,4),f&2&&Uw()},hostBindings:function(f,l){f&1&&Uh(`keydown.escape`,function(g){return l.onEscapeKeydown(g)},lE)},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:[_b([Et,{provide:Nt,useExisting:j},{provide:wt,useExisting:j}]),KD([Ze]),_h],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&&(jw(),yw(0,h,4,16,`div`,0)),f&2&&Ew(l.render()?0:-1)},dependencies:[xs,hi,Ze,pu,uu],encapsulation:2})})()};var Ot=class Ie{static ɵfac=function(t){return new(t||Ie)};static ɵmod=UD({type:Ie});static ɵinj=bu({imports:[At,hi,hi]})};var Vt=(i,u,e=0)=>{let t=10**e,n=i*t,a;switch(u){case`floor`:a=Math.floor(n);break;case`ceil`:a=Math.ceil(n);break;default:a=Math.round(n)}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=Q1(),this.onSubmit=z1()}onSubmitHandler(){this.onSubmit.emit(this.form().getRawValue())}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=BD({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,n){t&1&&(Pi(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`label`,3),gb(4,`Label Name`),fl(),Pi(5,`input`,4),KI(),fl()()(),Pi(6,`div`,5)(7,`div`,2)(8,`label`,3),gb(9,`Paper Width`),fl(),Pi(10,`p-inputgroup`)(11,`input`,6),KI(),fl(),Pi(12,`p-inputgroup-addon`)(13,`span`),gb(14,`cm`),fl()()()()(),Pi(15,`div`,5)(16,`div`,2),Lh(17,`label`,3),Pi(18,`p-inputgroup`)(19,`input`,7),KI(),fl(),Pi(20,`p-inputgroup-addon`)(21,`span`),gb(22,`px`),fl()()()()(),Pi(23,`div`,5)(24,`div`,2)(25,`label`,3),gb(26,`Sticker Width`),fl(),Pi(27,`p-inputgroup`)(28,`input`,8),KI(),fl(),Pi(29,`p-inputgroup-addon`)(30,`span`),gb(31,`cm`),fl()()()()(),Pi(32,`div`,5)(33,`div`,2),Lh(34,`label`,3),Pi(35,`p-inputgroup`)(36,`input`,9),KI(),fl(),Pi(37,`p-inputgroup-addon`)(38,`span`),gb(39,`px`),fl()()()()(),Pi(40,`div`,5)(41,`div`,2)(42,`label`,3),gb(43,`Sticker Height`),fl(),Pi(44,`p-inputgroup`)(45,`input`,10),KI(),fl(),Pi(46,`p-inputgroup-addon`)(47,`span`),gb(48,`cm`),fl()()()()(),Pi(49,`div`,5)(50,`div`,2),Lh(51,`label`,3),Pi(52,`p-inputgroup`)(53,`input`,11),KI(),fl(),Pi(54,`p-inputgroup-addon`)(55,`span`),gb(56,`px`),fl()()()()()()),t&2&&(kh(`formGroup`,n.form()),uI(5),XI(),uI(6),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI())},dependencies:[fh,Fo,oh,sh,vl$1,Tl,Vn,qn,Dn,Ul],encapsulation:2,changeDetection:1})}}return i})();var Wt=(()=>{class i{constructor(){this.form=Q1(),this.onSubmit=z1()}onSubmitHandler(){this.onSubmit.emit(this.form().getRawValue())}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=BD({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,n){t&1&&(Pi(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`label`,3),gb(4,`Label Name`),fl(),Pi(5,`input`,4),KI(),fl()()(),Pi(6,`div`,5)(7,`div`,2)(8,`label`,3),gb(9,`Paper Width`),fl(),Pi(10,`p-inputgroup`)(11,`input`,6),KI(),fl(),Pi(12,`p-inputgroup-addon`)(13,`span`),gb(14,`cm`),fl()()()()(),Pi(15,`div`,5)(16,`div`,2),Lh(17,`label`,3),Pi(18,`p-inputgroup`)(19,`input`,7),KI(),fl(),Pi(20,`p-inputgroup-addon`)(21,`span`),gb(22,`px`),fl()()()()(),Pi(23,`div`,5)(24,`div`,2)(25,`label`,3),gb(26,`Sticker Width`),fl(),Pi(27,`p-inputgroup`)(28,`input`,8),KI(),fl(),Pi(29,`p-inputgroup-addon`)(30,`span`),gb(31,`cm`),fl()()()()(),Pi(32,`div`,5)(33,`div`,2),Lh(34,`label`,3),Pi(35,`p-inputgroup`)(36,`input`,9),KI(),fl(),Pi(37,`p-inputgroup-addon`)(38,`span`),gb(39,`px`),fl()()()()(),Pi(40,`div`,5)(41,`div`,2)(42,`label`,3),gb(43,`Sticker Height`),fl(),Pi(44,`p-inputgroup`)(45,`input`,10),KI(),fl(),Pi(46,`p-inputgroup-addon`)(47,`span`),gb(48,`cm`),fl()()()()(),Pi(49,`div`,5)(50,`div`,2),Lh(51,`label`,3),Pi(52,`p-inputgroup`)(53,`input`,11),KI(),fl(),Pi(54,`p-inputgroup-addon`)(55,`span`),gb(56,`px`),fl()()()()()()),t&2&&(kh(`formGroup`,n.form()),uI(5),XI(),uI(6),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI())},dependencies:[fh,Fo,oh,sh,vl$1,Tl,Dn,Vn,qn,Ul],encapsulation:2,changeDetection:1})}}return i})();var qt=()=>({width:`35rem`});var jt=i=>({"border border-primary":i});var $t=()=>({class:`py-1`});var Zt=i=>({root:i});var zt=(i,u)=>u.ID;function Gt(i,u){if(i&1){let e=Sw();Pi(0,`div`,8)(1,`p-button`,9),Uh(`click`,function(){Qu(e);let n=Pw();return Zu(n.openCreate())}),fl()()}if(i&2){let e=Pw();uI(),kh(`disabled`,!e.isUserAdmin)}}function Ut(i,u){if(i&1){let e=Sw();Pi(0,`input`,23),Uh(`change`,function(){Qu(e);let n=Pw(2).$implicit,a=Pw(2);return Zu(a.onSelectionChange(n.ID))}),fl()}if(i&2){let e=Pw(2).$implicit,t=Pw(2);kh(`value`,e.ID)(`checked`,t.selectedTemplateId()===e.ID)}}function Jt(i,u){if(i&1&&(Pi(0,`div`,20)(1,`div`,21)(2,`span`),gb(3),fl()(),Pi(4,`div`,17),yw(5,Ut,1,2,`input`,22),fl()()),i&2){let e=Pw().$implicit,t=Pw(2);uI(3),ug(e.ConfigObject.Name),uI(2),Ew(t.selectedTemplateId()===e.ID?5:-1)}}function Kt(i,u){if(i&1&&(gl(0),Pi(1,`span`),gb(2),Pb(3,`number`),fl(),Pi(4,`span`),gb(5,`/`),fl(),Xi$1()),i&2){let e=Pw().$implicit;uI(2),ml(``,jb(3,1,e.ConfigObject.PaperWidthCM),`cm`)}}function Qt(i,u){if(i&1&&(gl(0),Pi(1,`span`),gb(2),Pb(3,`number`),fl(),Pi(4,`span`),gb(5,`/`),fl(),Xi$1()),i&2){let e=Pw().$implicit;uI(2),ml(``,jb(3,1,e.ConfigObject.StickerWidthCM),`cm`)}}function Xt(i,u){if(i&1&&(gl(0),Pi(1,`span`),gb(2),Pb(3,`number`),fl(),Pi(4,`span`),gb(5,`/`),fl(),Xi$1()),i&2){let e=Pw().$implicit;uI(2),ml(``,jb(3,1,e.ConfigObject.StickerHeightCM),`cm`)}}function Yt(i,u){if(i&1){let e=Sw();Pi(0,`div`,24)(1,`p-button`,25),Uh(`onClick`,function(n){Qu(e);let a=Ww(3),h=Pw().$implicit,d=Pw(2);return Zu(d.onMenuToggle(n,a,h.ID))}),fl(),Lh(2,`p-menu`,26,4),fl()}if(i&2){let e=Pw(3);uI(),kh(`outlined`,!0)(`pt`,Nb(5,Zt,Mb(4,$t))),uI(),kh(`model`,e.menuItems())(`popup`,!0)}}function ei(i,u){if(i&1){let e=Sw();Pi(0,`div`,12)(1,`p-card`,14),Uh(`click`,function(){let n=Qu(e).$implicit,a=Pw(2);return Zu(a.onSelectionChange(n.ID))}),Nh(2,Jt,6,2,`ng-template`,null,3,Bb),Pi(4,`div`,15)(5,`div`,16),gb(6,`Paper Width`),fl(),Pi(7,`div`,17)(8,`div`,18),Nh(9,Kt,6,3,`ng-container`,19),Pi(10,`span`),gb(11),Pb(12,`number`),fl()()()(),Pi(13,`div`,15)(14,`div`,16),gb(15,`Sticker Width`),fl(),Pi(16,`div`,17)(17,`div`,18),Nh(18,Qt,6,3,`ng-container`,19),Pi(19,`span`),gb(20),Pb(21,`number`),fl()()()(),Pi(22,`div`,15)(23,`div`,16),gb(24,`Sticker Height`),fl(),Pi(25,`div`,17)(26,`div`,18),Nh(27,Xt,6,3,`ng-container`,19),Pi(28,`span`),gb(29),Pb(30,`number`),fl()()()(),Nh(31,Yt,4,7,`ng-template`,null,2,Bb),fl()()}if(i&2){let e=u.$implicit,t=Pw(2);uI(),kh(`ngClass`,Nb(13,jt,t.selectedTemplateId()===e.ID)),uI(8),kh(`ngIf`,e.ConfigObject.PaperWidthCM),uI(2),ml(``,jb(12,7,e.ConfigObject.PaperWidth),`px`),uI(7),kh(`ngIf`,e.ConfigObject.StickerWidthCM),uI(2),ml(``,jb(21,9,e.ConfigObject.StickerWidth),`px`),uI(7),kh(`ngIf`,e.ConfigObject.StickerHeightCM),uI(2),ml(``,jb(30,11,e.ConfigObject.StickerHeight),`px`)}}function ti(i,u){i&1&&(Pi(0,`div`,13),gb(1,`No template found`),fl())}function ii(i,u){if(i&1&&(Pi(0,`p-card`,10)(1,`div`,11),ww(2,ei,33,15,`div`,12,zt,!1,ti,2,0,`div`,13),fl()()),i&2){let e=Pw();uI(2),bw(e.filteredTemplates())}}function oi(i,u){if(i&1){let e=Sw();Pi(0,`div`,27)(1,`p-button`,28),Uh(`onClick`,function(){Qu(e);let n=Pw();return Zu(n.onNextStep())}),fl()()}if(i&2){let e=Pw();uI(),kh(`disabled`,!e.hasSelectedTemplate())}}function ni(i,u){if(i&1){let e=Sw();Pi(0,`app-dialog-form-edit`,29),Uh(`onSubmit`,function(n){Qu(e);let a=Pw();return Zu(a.onDialogFormEdit(n))}),fl()}if(i&2){let e=Pw();kh(`form`,e.form)}}function ri(i,u){if(i&1){let e=Sw();Pi(0,`app-dialog-form-create`,29),Uh(`onSubmit`,function(n){Qu(e);let a=Pw();return Zu(a.onDialogFormCreate(n))}),fl()}if(i&2){let e=Pw();kh(`form`,e.form)}}function ai(i,u){if(i&1){let e=Sw();Pi(0,`p-button`,30),Uh(`onClick`,function(){Qu(e);let n=Pw();return Zu(n.closeDialog())}),fl(),Pi(1,`p-button`,31),Uh(`onClick`,function(){Qu(e);let n=Pw();return Zu(n.onSubmit())}),fl()}}var Ft=(()=>{class i$1{constructor(){this.templateService=I(zg),this.appStore=I(eu),this.profileTemplates=ti$1(null),this.fb=I(dh),this.router=I(W),this.route=I(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.querySearch=ti$1(``),this.hasSelectedTemplate=qb(()=>this.selectedTemplateId()!=null),this.filteredTemplates=qb(()=>{let e=this.querySearch().trim().toLowerCase(),t=this.profileTemplates()??[];return e?t.filter(n=>n.ConfigObject.Name?.toLowerCase().includes(e)):t})}get isUserAdmin(){return this.appStore.userRole()===`admin`}initDialogState(){this.route.queryParamMap.pipe(ql(e=>{let t=e.get(`dialog`),n=e.get(`id`);if(t===`create`){this.dialogMode.update(a=>`create`),this.dialogVisible.update(a=>!0),this.selectedTemplateId.update(a=>null),this.appStore.updateProfileTemplate(null),this.form.reset();return}if(t===`edit`&&n){this.dialogMode.update(a=>`edit`),this.dialogVisible.update(a=>!0),this.selectedTemplateId.update(a=>n),this.handleTemplateEdit(n);return}this.dialogVisible.update(a=>!1),this.dialogMode.update(a=>null),this.selectedTemplateId.update(a=>null),this.appStore.updateProfileTemplate(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:n,PaperWidthCM:a,StickerWidth:h,StickerWidthCM:d,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:n,paperWidthCM:M(a,n),stickerWidth:h,stickerWidthCM:M(d,h),stickerHeight:f,stickerHeightCM:M(l,f)}),this.isPatching.update(g=>!1)})).subscribe()}linkControls(e,t,n,a){let h=(d,f=2)=>d.toFixed(f);e.valueChanges.pipe(cm(),$e(()=>!this.isPatching()),ql(d=>{if(d!=null){let f=n(d);t.setValue(h(f),{emitEvent:!1})}})).subscribe(),t.valueChanges.pipe(cm(),$e(()=>!this.isPatching()),ql(d=>{if(d!=null){let f=a(d);e.setValue(h(f),{emitEvent:!1})}})).subscribe()}loadData(){let e=`https://${localStorage.getItem(Xt$1.Host)}/`;gm({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:n,taxes:a})=>{this.appStore.updateOutlets(n),this.appStore.updateTaxes(a),this.profileTemplates.set(t)}),i(`All template data loaded (even if some failed)`)).subscribe()}onMenuToggle(e,t,n){e.stopPropagation(),t.toggle(e),this.menuItems().forEach(a=>a.id=n)}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),this.commitSelectedTemplate()})}commitSelectedTemplate(){let e=this.selectedTemplateId(),t=e?(this.profileTemplates()??[]).find(n=>n.ID===e):null;if(!t){this.appStore.updateProfileTemplate(null);return}this.appStore.updateProfileTemplate(t),localStorage.setItem(Xt$1.SelectedProfileTemplate,JSON.stringify(t))}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{name:e,paperWidth:t,paperWidthCM:n,stickerWidth:a,stickerWidthCM:h,stickerHeight:d,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:+n,StickerWidth:+a,StickerWidthCM:+h,StickerHeight:+d,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:+n,StickerWidth:+a,StickerWidthCM:+h,StickerHeight:+d,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=BD({type:i$1,selectors:[[`app-choose-profile-template`]],decls:12,vars:11,consts:[[`actionButton`,``],[`content`,``],[`footer`,``],[`title`,``],[`menu`,``],[`pageTitle`,`Choose Paper Template`,3,`querySearchChange`,`searchable`,`querySearch`],[`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`],[1,`text-center`,`text-muted`,`p-4`],[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,n){if(t&1){let a=Sw();Pi(0,`app-main-panel`,5),hg(`querySearchChange`,function(d){return Qu(a),Eb(n.querySearch,d)||(n.querySearch=d),Zu(d)}),Nh(1,Gt,2,1,`ng-template`,null,0,Bb)(3,ii,5,1,`ng-template`,null,1,Bb)(5,oi,2,1,`ng-template`,null,2,Bb),fl(),Pi(7,`p-dialog`,6),hg(`visibleChange`,function(d){return Qu(a),Eb(n.dialogVisible,d)||(n.dialogVisible=d),Zu(d)}),yw(8,ni,1,1,`app-dialog-form-edit`,7),yw(9,ri,1,1,`app-dialog-form-create`,7),Nh(10,ai,2,0,`ng-template`,null,2,Bb),fl()}t&2&&(kh(`searchable`,!0),pg(`querySearch`,n.querySearch),uI(7),rb(Mb(10,qt)),kh(`closable`,!1)(`header`,n.dialogMode()==`create`?`Create New Label`:`Edit New Label`)(`modal`,!0),pg(`visible`,n.dialogVisible),uI(),Ew(n.dialogMode()==`edit`?8:-1),uI(),Ew(n.dialogMode()==`create`?9:-1))},dependencies:[cr,fh,D,Xi,Fs,Ns,Hl,Ee,Ot,zn,In,hh,Lt,Wt,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 li(i,u){i&1&&Lh(0,`app-choose-profile-template`)}function pi(i,u){i&1&&Lh(0,`choose-product`)}function si(i,u){if(i&1&&Lh(0,`app-barcode-preview`,1),i&2){let e=u.$implicit;kh(`cartItems`,e)}}function ci(i,u){i&1&&(Pi(0,`app-customize-label`),Nh(1,si,1,1,`ng-template`,null,0,Bb),fl())}function di(i,u){i&1&&Lh(0,`app-print-preview`)}var Ao=(()=>{class i{constructor(){this.storeService=I(qa),this.appStore=I(eu)}get cartItems(){return this.appStore.flattenedCartUnits()}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=BD({type:i,selectors:[[`app-barcode-wrapper`]],decls:4,vars:1,consts:[[`content`,``],[`previewMode`,`single`,3,`cartItems`]],template:function(t,n){if(t&1&&yw(0,li,1,0,`app-choose-profile-template`)(1,pi,1,0,`choose-product`)(2,ci,3,0,`app-customize-label`)(3,di,1,0,`app-print-preview`),t&2){let a;Ew((a=n.appStore.currentStep())===1?0:a===2?1:a===3?2:a===4?3:-1)}},dependencies:[Ft,lz,Q6,rd,xV],encapsulation:2,changeDetection:1})}}return i})();export{Ao as BarcodeWrapperComponent};
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 ue{name=`popover`;style=Dt;classes=Bt;inlineStyles=Ht;static ɵfac=(()=>{let e;return function(n){return(e||(e=cv(Z)))(n||Z)}})();static ɵprov=ue$1({token:Z,factory:Z.ɵfac})};var Nt=new x(`POPOVER_INSTANCE`);var At=class j extends ct{componentName=`Popover`;$pcPopover=I(Nt,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=I(Ze,{self:!0});ariaLabel=Q1();ariaLabelledBy=Q1();dismissable=Q1(!0,{transform:rj});style=Q1();styleClass=Q1();appendTo=Q1(`body`);autoZIndex=Q1(!0,{transform:rj});ariaCloseLabel=Q1();baseZIndex=Q1(0,{transform:oj});focusOnShow=Q1(!0,{transform:rj});motionOptions=Q1(void 0);computedMotionOptions=qb(()=>F(F({},this.ptm(`motion`)),this.motionOptions()));onShow=z1();onHide=z1();$appendTo=qb(()=>this.appendTo()||this.config.overlayAppendTo());container;overlayVisible=ti$1(!1);render=ti$1(!1);selfClick=!1;documentClickListener;target=null;willHide;scrollHandler;documentResizeListener;contentTemplate=K1(`content`,{descendants:!1});onCloseClickCallback=this.onCloseClick.bind(this);contentTemplateContext=qb(()=>({closeCallback:this.onCloseClickCallback}));destroyCallback;overlayEventListener;overlaySubscription;_componentStyle=I(Et);overlayService=I(Dl);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm(`host`))}bindDocumentClickListener(){if(sc(this.platformId)&&!this.documentClickListener){let e=vl()?`touchstart`:`click`,t=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentClickListener=this.renderer.listen(t,e,n=>{if(!this.dismissable())return;let a=cd(n,this.container),h=cd(n,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`?ol(this.$overlayParent(this.document.body,this.container),this.container):ol(this.$overlayParent(this.$appendTo(),this.container),this.container))}restoreAppend(){this.container&&this.$appendTo()&&this.$appendTo()!==`self`&&ol(this.el.nativeElement,this.container)}setZIndex(){this.autoZIndex()&&yc.set(`overlay`,this.container,this.baseZIndex()+this.config.zIndex.overlay)}align(){if(this.target&&this.container){nl(this.container,this.target,!1);let e=Yi(this.container),t=Yi(this.target),n=e.left,a=e.top,h=t.left,d=t.top,f=this.document.defaultView?.getComputedStyle(this.container).getPropertyValue(`border-radius`),l=0;n<h&&(l=h-n-parseFloat(f)*2),this.container.style.setProperty(this.$styleScope.resolvers.$dt(`popover.arrow.left`).name,`${l}px`),a<d&&(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()&&yc.clear(this.container),this.onContainerDestroy(),this.onHide.emit({}),this.render.set(!1),this.container=null)}focus(){let e=cl(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()&&!Sl()&&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 ad(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()&&yc.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(n){return(e||(e=cv(j)))(n||j)}})();static ɵcmp=(function(){let e=[`content`],t=[`*`];function n(d,f){d&1&&jh(0)}function a(d,f){if(d&1&&Nh(0,n,1,0,`ng-container`,3),d&2){let l=Pw(2);kh(`ngTemplateOutlet`,l.contentTemplate())(`ngTemplateOutletContext`,l.contentTemplateContext())}}function h(d,f){if(d&1){let l=Sw();Pi(0,`div`,1),Uh(`click`,function(g){Qu(l);let D=Pw();return Zu(D.onOverlayClick(g))})(`pMotionOnEnter`,function(g){Qu(l);let D=Pw();return Zu(D.onAnimationStart(g))})(`pMotionOnAfterLeave`,function(){Qu(l);let g=Pw();return Zu(g.onAnimationEnd())}),Pi(1,`div`,2),Uh(`click`,function(g){Qu(l);let D=Pw();return Zu(D.onContentClick(g))})(`mousedown`,function(g){Qu(l);let D=Pw();return Zu(D.onContentClick(g))}),Vw(2),yw(3,a,1,2,`ng-container`),fl()()}if(d&2){let l=Pw();rb(l.sx(`root`)),ib(l.cn(l.cx(`root`),l.styleClass())),kh(`pBind`,l.ptm(`root`))(`pMotion`,l.overlayVisible())(`pMotionName`,l.pcn(`p-anchored-overlay`))(`pMotionAppear`,!0)(`pMotionOptions`,l.computedMotionOptions()),Oh(`aria-modal`,l.overlayVisible())(`aria-label`,l.ariaLabel())(`aria-labelledBy`,l.ariaLabelledBy()),uI(),ib(l.cx(`content`)),kh(`pBind`,l.ptm(`content`)),uI(2),Ew(l.contentTemplate()?3:-1)}}return BD({type:j,selectors:[[`p-popover`]],contentQueries:function(f,l,M){f&1&&Qh(M,l.contentTemplate,e,4),f&2&&Uw()},hostBindings:function(f,l){f&1&&Uh(`keydown.escape`,function(g){return l.onEscapeKeydown(g)},lE)},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:[_b([Et,{provide:Nt,useExisting:j},{provide:wt,useExisting:j}]),KD([Ze]),_h],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&&(jw(),yw(0,h,4,16,`div`,0)),f&2&&Ew(l.render()?0:-1)},dependencies:[xs,hi,Ze,pu,uu],encapsulation:2})})()};var Ot=class Ie{static ɵfac=function(t){return new(t||Ie)};static ɵmod=UD({type:Ie});static ɵinj=bu({imports:[At,hi,hi]})};var Vt=(i,u,e=0)=>{let t=10**e,n=i*t,a;switch(u){case`floor`:a=Math.floor(n);break;case`ceil`:a=Math.ceil(n);break;default:a=Math.round(n)}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=Q1(),this.onSubmit=z1()}onSubmitHandler(){this.onSubmit.emit(this.form().getRawValue())}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=BD({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,n){t&1&&(Pi(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`label`,3),gb(4,`Label Name`),fl(),Pi(5,`input`,4),KI(),fl()()(),Pi(6,`div`,5)(7,`div`,2)(8,`label`,3),gb(9,`Paper Width`),fl(),Pi(10,`p-inputgroup`)(11,`input`,6),KI(),fl(),Pi(12,`p-inputgroup-addon`)(13,`span`),gb(14,`cm`),fl()()()()(),Pi(15,`div`,5)(16,`div`,2),Lh(17,`label`,3),Pi(18,`p-inputgroup`)(19,`input`,7),KI(),fl(),Pi(20,`p-inputgroup-addon`)(21,`span`),gb(22,`px`),fl()()()()(),Pi(23,`div`,5)(24,`div`,2)(25,`label`,3),gb(26,`Sticker Width`),fl(),Pi(27,`p-inputgroup`)(28,`input`,8),KI(),fl(),Pi(29,`p-inputgroup-addon`)(30,`span`),gb(31,`cm`),fl()()()()(),Pi(32,`div`,5)(33,`div`,2),Lh(34,`label`,3),Pi(35,`p-inputgroup`)(36,`input`,9),KI(),fl(),Pi(37,`p-inputgroup-addon`)(38,`span`),gb(39,`px`),fl()()()()(),Pi(40,`div`,5)(41,`div`,2)(42,`label`,3),gb(43,`Sticker Height`),fl(),Pi(44,`p-inputgroup`)(45,`input`,10),KI(),fl(),Pi(46,`p-inputgroup-addon`)(47,`span`),gb(48,`cm`),fl()()()()(),Pi(49,`div`,5)(50,`div`,2),Lh(51,`label`,3),Pi(52,`p-inputgroup`)(53,`input`,11),KI(),fl(),Pi(54,`p-inputgroup-addon`)(55,`span`),gb(56,`px`),fl()()()()()()),t&2&&(kh(`formGroup`,n.form()),uI(5),XI(),uI(6),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI())},dependencies:[fh,Fo,oh,sh,vl$1,Tl,Vn,qn,Dn,Vl],encapsulation:2,changeDetection:1})}}return i})();var Wt=(()=>{class i{constructor(){this.form=Q1(),this.onSubmit=z1()}onSubmitHandler(){this.onSubmit.emit(this.form().getRawValue())}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=BD({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,n){t&1&&(Pi(0,`div`,0)(1,`div`,1)(2,`div`,2)(3,`label`,3),gb(4,`Label Name`),fl(),Pi(5,`input`,4),KI(),fl()()(),Pi(6,`div`,5)(7,`div`,2)(8,`label`,3),gb(9,`Paper Width`),fl(),Pi(10,`p-inputgroup`)(11,`input`,6),KI(),fl(),Pi(12,`p-inputgroup-addon`)(13,`span`),gb(14,`cm`),fl()()()()(),Pi(15,`div`,5)(16,`div`,2),Lh(17,`label`,3),Pi(18,`p-inputgroup`)(19,`input`,7),KI(),fl(),Pi(20,`p-inputgroup-addon`)(21,`span`),gb(22,`px`),fl()()()()(),Pi(23,`div`,5)(24,`div`,2)(25,`label`,3),gb(26,`Sticker Width`),fl(),Pi(27,`p-inputgroup`)(28,`input`,8),KI(),fl(),Pi(29,`p-inputgroup-addon`)(30,`span`),gb(31,`cm`),fl()()()()(),Pi(32,`div`,5)(33,`div`,2),Lh(34,`label`,3),Pi(35,`p-inputgroup`)(36,`input`,9),KI(),fl(),Pi(37,`p-inputgroup-addon`)(38,`span`),gb(39,`px`),fl()()()()(),Pi(40,`div`,5)(41,`div`,2)(42,`label`,3),gb(43,`Sticker Height`),fl(),Pi(44,`p-inputgroup`)(45,`input`,10),KI(),fl(),Pi(46,`p-inputgroup-addon`)(47,`span`),gb(48,`cm`),fl()()()()(),Pi(49,`div`,5)(50,`div`,2),Lh(51,`label`,3),Pi(52,`p-inputgroup`)(53,`input`,11),KI(),fl(),Pi(54,`p-inputgroup-addon`)(55,`span`),gb(56,`px`),fl()()()()()()),t&2&&(kh(`formGroup`,n.form()),uI(5),XI(),uI(6),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI(),uI(9),kh(`precision`,2),XI(),uI(8),kh(`precision`,2),XI())},dependencies:[fh,Fo,oh,sh,vl$1,Tl,Dn,Vn,qn,Vl],encapsulation:2,changeDetection:1})}}return i})();var qt=()=>({width:`35rem`});var jt=i=>({"border border-primary":i});var $t=()=>({class:`py-1`});var Zt=i=>({root:i});var zt=(i,u)=>u.ID;function Gt(i,u){if(i&1){let e=Sw();Pi(0,`div`,8)(1,`p-button`,9),Uh(`click`,function(){Qu(e);let n=Pw();return Zu(n.openCreate())}),fl()()}if(i&2){let e=Pw();uI(),kh(`disabled`,!e.isUserAdmin)}}function Ut(i,u){if(i&1){let e=Sw();Pi(0,`input`,23),Uh(`change`,function(){Qu(e);let n=Pw(2).$implicit,a=Pw(2);return Zu(a.onSelectionChange(n.ID))}),fl()}if(i&2){let e=Pw(2).$implicit,t=Pw(2);kh(`value`,e.ID)(`checked`,t.selectedTemplateId()===e.ID)}}function Jt(i,u){if(i&1&&(Pi(0,`div`,20)(1,`div`,21)(2,`span`),gb(3),fl()(),Pi(4,`div`,17),yw(5,Ut,1,2,`input`,22),fl()()),i&2){let e=Pw().$implicit,t=Pw(2);uI(3),ug(e.ConfigObject.Name),uI(2),Ew(t.selectedTemplateId()===e.ID?5:-1)}}function Kt(i,u){if(i&1&&(gl(0),Pi(1,`span`),gb(2),Pb(3,`number`),fl(),Pi(4,`span`),gb(5,`/`),fl(),Xi$1()),i&2){let e=Pw().$implicit;uI(2),ml(``,jb(3,1,e.ConfigObject.PaperWidthCM),`cm`)}}function Qt(i,u){if(i&1&&(gl(0),Pi(1,`span`),gb(2),Pb(3,`number`),fl(),Pi(4,`span`),gb(5,`/`),fl(),Xi$1()),i&2){let e=Pw().$implicit;uI(2),ml(``,jb(3,1,e.ConfigObject.StickerWidthCM),`cm`)}}function Xt(i,u){if(i&1&&(gl(0),Pi(1,`span`),gb(2),Pb(3,`number`),fl(),Pi(4,`span`),gb(5,`/`),fl(),Xi$1()),i&2){let e=Pw().$implicit;uI(2),ml(``,jb(3,1,e.ConfigObject.StickerHeightCM),`cm`)}}function Yt(i,u){if(i&1){let e=Sw();Pi(0,`div`,24)(1,`p-button`,25),Uh(`onClick`,function(n){Qu(e);let a=Ww(3),h=Pw().$implicit,d=Pw(2);return Zu(d.onMenuToggle(n,a,h.ID))}),fl(),Lh(2,`p-menu`,26,4),fl()}if(i&2){let e=Pw(3);uI(),kh(`outlined`,!0)(`pt`,Nb(5,Zt,Mb(4,$t))),uI(),kh(`model`,e.menuItems())(`popup`,!0)}}function ei(i,u){if(i&1){let e=Sw();Pi(0,`div`,12)(1,`p-card`,14),Uh(`click`,function(){let n=Qu(e).$implicit,a=Pw(2);return Zu(a.onSelectionChange(n.ID))}),Nh(2,Jt,6,2,`ng-template`,null,3,Bb),Pi(4,`div`,15)(5,`div`,16),gb(6,`Paper Width`),fl(),Pi(7,`div`,17)(8,`div`,18),Nh(9,Kt,6,3,`ng-container`,19),Pi(10,`span`),gb(11),Pb(12,`number`),fl()()()(),Pi(13,`div`,15)(14,`div`,16),gb(15,`Sticker Width`),fl(),Pi(16,`div`,17)(17,`div`,18),Nh(18,Qt,6,3,`ng-container`,19),Pi(19,`span`),gb(20),Pb(21,`number`),fl()()()(),Pi(22,`div`,15)(23,`div`,16),gb(24,`Sticker Height`),fl(),Pi(25,`div`,17)(26,`div`,18),Nh(27,Xt,6,3,`ng-container`,19),Pi(28,`span`),gb(29),Pb(30,`number`),fl()()()(),Nh(31,Yt,4,7,`ng-template`,null,2,Bb),fl()()}if(i&2){let e=u.$implicit,t=Pw(2);uI(),kh(`ngClass`,Nb(13,jt,t.selectedTemplateId()===e.ID)),uI(8),kh(`ngIf`,e.ConfigObject.PaperWidthCM),uI(2),ml(``,jb(12,7,e.ConfigObject.PaperWidth),`px`),uI(7),kh(`ngIf`,e.ConfigObject.StickerWidthCM),uI(2),ml(``,jb(21,9,e.ConfigObject.StickerWidth),`px`),uI(7),kh(`ngIf`,e.ConfigObject.StickerHeightCM),uI(2),ml(``,jb(30,11,e.ConfigObject.StickerHeight),`px`)}}function ti(i,u){i&1&&(Pi(0,`div`,13),gb(1,`No template found`),fl())}function ii(i,u){if(i&1&&(Pi(0,`p-card`,10)(1,`div`,11),ww(2,ei,33,15,`div`,12,zt,!1,ti,2,0,`div`,13),fl()()),i&2){let e=Pw();uI(2),bw(e.filteredTemplates())}}function oi(i,u){if(i&1){let e=Sw();Pi(0,`div`,27)(1,`p-button`,28),Uh(`onClick`,function(){Qu(e);let n=Pw();return Zu(n.onNextStep())}),fl()()}if(i&2){let e=Pw();uI(),kh(`disabled`,!e.hasSelectedTemplate())}}function ni(i,u){if(i&1){let e=Sw();Pi(0,`app-dialog-form-edit`,29),Uh(`onSubmit`,function(n){Qu(e);let a=Pw();return Zu(a.onDialogFormEdit(n))}),fl()}if(i&2){let e=Pw();kh(`form`,e.form)}}function ri(i,u){if(i&1){let e=Sw();Pi(0,`app-dialog-form-create`,29),Uh(`onSubmit`,function(n){Qu(e);let a=Pw();return Zu(a.onDialogFormCreate(n))}),fl()}if(i&2){let e=Pw();kh(`form`,e.form)}}function ai(i,u){if(i&1){let e=Sw();Pi(0,`p-button`,30),Uh(`onClick`,function(){Qu(e);let n=Pw();return Zu(n.closeDialog())}),fl(),Pi(1,`p-button`,31),Uh(`onClick`,function(){Qu(e);let n=Pw();return Zu(n.onSubmit())}),fl()}}var Ft=(()=>{class i$1{constructor(){this.templateService=I(zg),this.appStore=I(eu),this.profileTemplates=ti$1(null),this.fb=I(dh),this.router=I(W),this.route=I(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.querySearch=ti$1(``),this.hasSelectedTemplate=qb(()=>this.selectedTemplateId()!=null),this.filteredTemplates=qb(()=>{let e=this.querySearch().trim().toLowerCase(),t=this.profileTemplates()??[];return e?t.filter(n=>n.ConfigObject.Name?.toLowerCase().includes(e)):t})}get isUserAdmin(){return this.appStore.userRole()===`admin`}initDialogState(){this.route.queryParamMap.pipe(ql(e=>{let t=e.get(`dialog`),n=e.get(`id`);if(t===`create`){this.dialogMode.update(a=>`create`),this.dialogVisible.update(a=>!0),this.selectedTemplateId.update(a=>null),this.appStore.updateProfileTemplate(null),this.form.reset();return}if(t===`edit`&&n){this.dialogMode.update(a=>`edit`),this.dialogVisible.update(a=>!0),this.selectedTemplateId.update(a=>n),this.handleTemplateEdit(n);return}this.dialogVisible.update(a=>!1),this.dialogMode.update(a=>null),this.selectedTemplateId.update(a=>null),this.appStore.updateProfileTemplate(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:n,PaperWidthCM:a,StickerWidth:h,StickerWidthCM:d,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:n,paperWidthCM:M(a,n),stickerWidth:h,stickerWidthCM:M(d,h),stickerHeight:f,stickerHeightCM:M(l,f)}),this.isPatching.update(g=>!1)})).subscribe()}linkControls(e,t,n,a){let h=(d,f=2)=>d.toFixed(f);e.valueChanges.pipe(cm(),$e(()=>!this.isPatching()),ql(d=>{if(d!=null){let f=n(d);t.setValue(h(f),{emitEvent:!1})}})).subscribe(),t.valueChanges.pipe(cm(),$e(()=>!this.isPatching()),ql(d=>{if(d!=null){let f=a(d);e.setValue(h(f),{emitEvent:!1})}})).subscribe()}loadData(){let e=`https://${localStorage.getItem(Xt$1.Host)}/`;gm({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:n,taxes:a})=>{this.appStore.updateOutlets(n),this.appStore.updateTaxes(a),this.profileTemplates.set(t)}),i(`All template data loaded (even if some failed)`)).subscribe()}onMenuToggle(e,t,n){e.stopPropagation(),t.toggle(e),this.menuItems().forEach(a=>a.id=n)}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),this.commitSelectedTemplate()})}commitSelectedTemplate(){let e=this.selectedTemplateId(),t=e?(this.profileTemplates()??[]).find(n=>n.ID===e):null;if(!t){this.appStore.updateProfileTemplate(null);return}this.appStore.updateProfileTemplate(t),localStorage.setItem(Xt$1.SelectedProfileTemplate,JSON.stringify(t))}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{name:e,paperWidth:t,paperWidthCM:n,stickerWidth:a,stickerWidthCM:h,stickerHeight:d,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:+n,StickerWidth:+a,StickerWidthCM:+h,StickerHeight:+d,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:+n,StickerWidth:+a,StickerWidthCM:+h,StickerHeight:+d,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=BD({type:i$1,selectors:[[`app-choose-profile-template`]],decls:12,vars:11,consts:[[`actionButton`,``],[`content`,``],[`footer`,``],[`title`,``],[`menu`,``],[`pageTitle`,`Choose Paper Template`,3,`querySearchChange`,`searchable`,`querySearch`],[`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`],[1,`text-center`,`text-muted`,`p-4`],[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,n){if(t&1){let a=Sw();Pi(0,`app-main-panel`,5),hg(`querySearchChange`,function(d){return Qu(a),Eb(n.querySearch,d)||(n.querySearch=d),Zu(d)}),Nh(1,Gt,2,1,`ng-template`,null,0,Bb)(3,ii,5,1,`ng-template`,null,1,Bb)(5,oi,2,1,`ng-template`,null,2,Bb),fl(),Pi(7,`p-dialog`,6),hg(`visibleChange`,function(d){return Qu(a),Eb(n.dialogVisible,d)||(n.dialogVisible=d),Zu(d)}),yw(8,ni,1,1,`app-dialog-form-edit`,7),yw(9,ri,1,1,`app-dialog-form-create`,7),Nh(10,ai,2,0,`ng-template`,null,2,Bb),fl()}t&2&&(kh(`searchable`,!0),pg(`querySearch`,n.querySearch),uI(7),rb(Mb(10,qt)),kh(`closable`,!1)(`header`,n.dialogMode()==`create`?`Create New Label`:`Edit New Label`)(`modal`,!0),pg(`visible`,n.dialogVisible),uI(),Ew(n.dialogMode()==`edit`?8:-1),uI(),Ew(n.dialogMode()==`create`?9:-1))},dependencies:[cr,fh,D,Xi,Fs,Ns,$l,Ee,Ot,zn,In,hh,Lt,Wt,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 li(i,u){i&1&&Lh(0,`app-choose-profile-template`)}function pi(i,u){i&1&&Lh(0,`choose-product`)}function si(i,u){if(i&1&&Lh(0,`app-barcode-preview`,1),i&2){let e=u.$implicit;kh(`cartItems`,e)}}function ci(i,u){i&1&&(Pi(0,`app-customize-label`),Nh(1,si,1,1,`ng-template`,null,0,Bb),fl())}function di(i,u){i&1&&Lh(0,`app-print-preview`)}var Ao=(()=>{class i{constructor(){this.storeService=I(qa),this.appStore=I(eu)}get cartItems(){return this.appStore.flattenedCartUnits()}static{this.ɵfac=function(t){return new(t||i)}}static{this.ɵcmp=BD({type:i,selectors:[[`app-barcode-wrapper`]],decls:4,vars:1,consts:[[`content`,``],[`previewMode`,`single`,3,`cartItems`]],template:function(t,n){if(t&1&&yw(0,li,1,0,`app-choose-profile-template`)(1,pi,1,0,`choose-product`)(2,ci,3,0,`app-customize-label`)(3,di,1,0,`app-print-preview`),t&2){let a;Ew((a=n.appStore.currentStep())===1?0:a===2?1:a===3?2:a===4?3:-1)}},dependencies:[Ft,sz,Z6,od,_V],encapsulation:2,changeDetection:1})}}return i})();export{Ao as BarcodeWrapperComponent};
@@ -1 +1 @@
1
- import{n as dr,t as Ac}from"./chunk-DGqSoTkS.js";import"./chunk-cD6pvlNi.js";import"./main-6DI32WEG.js";import{t as i}from"./chunk-S3eMZOYS.js";import{t as h}from"./chunk-fDWFTK5c.js";import{f as cr,t as $r}from"./chunk-35bh3Tii.js";import"./chunk-B1TuWbQG.js";import"./chunk-CmmFAMM4.js";import{$n as gb,Ct as Pw,Jn as fl,R as I,Sr as kh,Wr as ql,bt as Pi,d as Bb,ei as ti,ii as uI,lt as Nh,nt as Mb,oi as ug,u as BD}from"./chunk-rvtowGG1.js";var E=()=>({"min-width":`50rem`});function D(t,p){}function G(t,p){t&1&&(Pi(0,`tr`)(1,`th`),gb(2,`Name`),fl(),Pi(3,`th`),gb(4,`Desc`),fl()())}function T(t,p){if(t&1&&(Pi(0,`tr`)(1,`td`)(2,`span`),gb(3),fl()(),Pi(4,`td`)(5,`span`),gb(6),fl()()()),t&2){let e=p.$implicit;uI(3),ug(e.Name),uI(3),ug(e.Description)}}function L(t,p){if(t&1&&(Pi(0,`p-panel`)(1,`p-table`,5),Nh(2,G,5,0,`ng-template`,null,2,Bb)(4,T,7,2,`ng-template`,null,3,Bb),fl()()),t&2){let e=Pw();uI(),kh(`value`,e.groupList())(`tableStyle`,Mb(2,E))}}var K=(()=>{class t{constructor(){this.setupUserService=I(h),this.groupList=ti([])}ngOnInit(){this.setupUserService.getGroupList().pipe(i(`Groups`),ql(e=>this.groupList.set(e.Data))).subscribe()}static{this.ɵfac=function(l){return new(l||t)}}static{this.ɵcmp=BD({type:t,selectors:[[`app-groups`]],decls:5,vars:0,consts:[[`actionButton`,``],[`content`,``],[`header`,``],[`body`,``],[`pageTitle`,`Users`],[`dataKey`,`UserID`,3,`value`,`tableStyle`]],template:function(l,M){l&1&&(Pi(0,`app-main-panel`,4),Nh(1,D,0,0,`ng-template`,null,0,Bb)(3,L,6,3,`ng-template`,null,1,Bb),fl())},dependencies:[cr,$r,Ac,dr],styles:[`.p-datatable .p-datatable-thead tr th{background-color:#f6f6f6!important}`],changeDetection:1})}}return t})();export{K as GroupsComponent};
1
+ import{n as dr,t as Ac}from"./chunk-CLi31iT7.js";import"./chunk-C3VygkZG.js";import"./main-2MSSWA5I.js";import{t as i}from"./chunk-S3eMZOYS.js";import{t as h}from"./chunk-fDWFTK5c.js";import{f as cr,t as $r}from"./chunk-35bh3Tii.js";import"./chunk-B1TuWbQG.js";import"./chunk-CmmFAMM4.js";import{$n as gb,Ct as Pw,Jn as fl,R as I,Sr as kh,Wr as ql,bt as Pi,d as Bb,ei as ti,ii as uI,lt as Nh,nt as Mb,oi as ug,u as BD}from"./chunk-rvtowGG1.js";var E=()=>({"min-width":`50rem`});function D(t,p){}function G(t,p){t&1&&(Pi(0,`tr`)(1,`th`),gb(2,`Name`),fl(),Pi(3,`th`),gb(4,`Desc`),fl()())}function T(t,p){if(t&1&&(Pi(0,`tr`)(1,`td`)(2,`span`),gb(3),fl()(),Pi(4,`td`)(5,`span`),gb(6),fl()()()),t&2){let e=p.$implicit;uI(3),ug(e.Name),uI(3),ug(e.Description)}}function L(t,p){if(t&1&&(Pi(0,`p-panel`)(1,`p-table`,5),Nh(2,G,5,0,`ng-template`,null,2,Bb)(4,T,7,2,`ng-template`,null,3,Bb),fl()()),t&2){let e=Pw();uI(),kh(`value`,e.groupList())(`tableStyle`,Mb(2,E))}}var K=(()=>{class t{constructor(){this.setupUserService=I(h),this.groupList=ti([])}ngOnInit(){this.setupUserService.getGroupList().pipe(i(`Groups`),ql(e=>this.groupList.set(e.Data))).subscribe()}static{this.ɵfac=function(l){return new(l||t)}}static{this.ɵcmp=BD({type:t,selectors:[[`app-groups`]],decls:5,vars:0,consts:[[`actionButton`,``],[`content`,``],[`header`,``],[`body`,``],[`pageTitle`,`Users`],[`dataKey`,`UserID`,3,`value`,`tableStyle`]],template:function(l,M){l&1&&(Pi(0,`app-main-panel`,4),Nh(1,D,0,0,`ng-template`,null,0,Bb)(3,L,6,3,`ng-template`,null,1,Bb),fl())},dependencies:[cr,$r,Ac,dr],styles:[`.p-datatable .p-datatable-thead tr th{background-color:#f6f6f6!important}`],changeDetection:1})}}return t})();export{K as GroupsComponent};
@@ -0,0 +1 @@
1
+ var e=[{path:``,children:[{path:`v2/print-mode`,loadComponent:()=>import(`./chunk-D5zbEW_c.js`).then(o=>o.PrintModeSelectorComponent)},{path:``,children:[{path:`barcode`,loadComponent:()=>import(`./chunk-CgYfRDd0.js`).then(o=>o.BarcodeWrapperComponent)},{path:`price-label`,loadComponent:()=>import(`./chunk-BtbScYM0.js`).then(o=>o.PriceLabelWrapperComponent)},{path:`setup`,children:[{path:`users`,loadComponent:()=>import(`./chunk-BFvnPjD8.js`).then(o=>o.UsersComponent)},{path:`groups`,loadComponent:()=>import(`./chunk-CiEyMZ-V.js`).then(o=>o.GroupsComponent)},{path:`credential`,loadComponent:()=>import(`./chunk-DZSHa5qA.js`).then(o=>o.CredentialComponent)}]}]}]}];export{e as dashboardRoutes};
@@ -1 +1 @@
1
- import{_ as W$1,m as Ba,u as Sh,v as Xt,x as eu}from"./main-6DI32WEG.js";import{t as D}from"./chunk-BZI-5oM5.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-CmmFAMM4.js";import{$n as gb,At as Qu,Bt as Sw,Ct as Pw,Jn as fl,Kt as Uh,O as Ew,Pr as np,R as I,Sr as kh,X as KI,bt as Pi,ct as Nb,ei as ti,et as Lh,gn as Zu,ii as uI,in as XI,jr as ml,oi as ug,rn as Ww,u as BD,yi as yw}from"./chunk-rvtowGG1.js";var P=n=>({active:n});function W(n,_){n&1&&(Pi(0,`h4`),gb(1,`This menu is for printing barcodes that will be placed directly on your products.`),fl())}function X(n,_){n&1&&(Pi(0,`h4`),gb(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`),gb(1,`This option is for setting up user accounts and managing user permissions.`),fl())}function Z(n,_){if(n&1){let l=Sw();Pi(0,`div`,27),Uh(`click`,function(){Qu(l),Pw();let o=Ww(36);return Zu(o.click())}),Pi(1,`div`,28)(2,`div`,29),Lh(3,`i`,7),fl(),Pi(4,`h6`,31),gb(5,`Setup`),fl(),Pi(6,`h4`,32),gb(7,`Users`),fl()()()}if(n&2){let l=Pw();kh(`ngClass`,Nb(1,P,l.form.get(`printMode`).value===3))}}var pe=(()=>{class n{constructor(){this.domain=ti(``),this.username=ti(``),this.appStore=I(eu),this.router=I(W$1),this.fb=I(dh),this.authService=I(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=BD({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=Sw();Pi(0,`nav`,3)(1,`h2`,4),gb(2,`Choose Barcode Mode`),fl(),Pi(3,`div`,5)(4,`button`,6),Lh(5,`i`,7),fl(),Pi(6,`ul`,8)(7,`li`,9)(8,`span`,10),gb(9,`User Profile`),fl()(),Pi(10,`li`,11)(11,`div`,12),Lh(12,`i`,13),fl(),Pi(13,`div`)(14,`h6`,14),gb(15),fl(),Pi(16,`h6`,15)(17,`a`,16),gb(18),fl()()()(),Pi(19,`li`),Lh(20,`hr`,17),fl(),Pi(21,`li`)(22,`button`,18),Uh(`click`,function(){return o.authService.logout()}),gb(23,` SIGN OUT `),fl()()()()(),Pi(24,`div`,19)(25,`main`,20)(26,`div`,21),yw(27,W,2,0,`h4`),yw(28,X,2,0,`h4`),yw(29,Y,2,0,`h4`),fl(),Pi(30,`div`,22)(31,`input`,23,0),KI(),fl(),Pi(33,`input`,24,1),KI(),fl(),Pi(35,`input`,24,2),KI(),fl(),Pi(37,`div`,25)(38,`div`,26)(39,`div`,27),Uh(`click`,function(){Qu(E);let M=Ww(32);return Zu(M.click())}),Pi(40,`div`,28)(41,`div`,29),Lh(42,`i`,30),fl(),Pi(43,`h6`,31),gb(44,`Print`),fl(),Pi(45,`h4`,32),gb(46,`Product`),fl()()(),Pi(47,`div`,27),Uh(`click`,function(){Qu(E);let M=Ww(34);return Zu(M.click())}),Pi(48,`div`,28)(49,`div`,29),Lh(50,`i`,33),fl(),Pi(51,`h6`,31),gb(52,`Print`),fl(),Pi(53,`h4`,32),gb(54,`Shelf`),fl()()(),yw(55,Z,8,3,`div`,34),fl(),Pi(56,`div`,35)(57,`input`,36),KI(),fl(),Pi(58,`label`,37),gb(59,`Remember my decision`),fl()(),Pi(60,`div`,38)(61,`button`,39),Uh(`click`,function(){return o.onNext()}),gb(62,` Next `),fl()()()()()()}s&2&&(uI(15),ug(o.username()),uI(2),kh(`href`,`https://`+o.domain(),np),uI(),ml(` `,o.domain(),` `),uI(9),Ew(o.form.get(`printMode`).value===1?27:-1),uI(),Ew(o.form.get(`printMode`).value===2?28:-1),uI(),Ew(o.form.get(`printMode`).value===3?29:-1),uI(),kh(`formGroup`,o.form),uI(),kh(`value`,1),XI(),uI(2),kh(`value`,2),XI(),uI(2),kh(`value`,3),XI(),uI(4),kh(`ngClass`,Nb(13,P,o.form.get(`printMode`).value===1)),uI(8),kh(`ngClass`,Nb(15,P,o.form.get(`printMode`).value===2)),uI(8),Ew(o.isUserAdmin?55:-1),uI(2),XI())},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-2MSSWA5I.js";import{t as D}from"./chunk-BZI-5oM5.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-CmmFAMM4.js";import{$n as gb,At as Qu,Bt as Sw,Ct as Pw,Jn as fl,Kt as Uh,O as Ew,Pr as np,R as I,Sr as kh,X as KI,bt as Pi,ct as Nb,ei as ti,et as Lh,gn as Zu,ii as uI,in as XI,jr as ml,oi as ug,rn as Ww,u as BD,yi as yw}from"./chunk-rvtowGG1.js";var P=n=>({active:n});function W(n,_){n&1&&(Pi(0,`h4`),gb(1,`This menu is for printing barcodes that will be placed directly on your products.`),fl())}function X(n,_){n&1&&(Pi(0,`h4`),gb(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`),gb(1,`This option is for setting up user accounts and managing user permissions.`),fl())}function Z(n,_){if(n&1){let l=Sw();Pi(0,`div`,27),Uh(`click`,function(){Qu(l),Pw();let o=Ww(36);return Zu(o.click())}),Pi(1,`div`,28)(2,`div`,29),Lh(3,`i`,7),fl(),Pi(4,`h6`,31),gb(5,`Setup`),fl(),Pi(6,`h4`,32),gb(7,`Users`),fl()()()}if(n&2){let l=Pw();kh(`ngClass`,Nb(1,P,l.form.get(`printMode`).value===3))}}var pe=(()=>{class n{constructor(){this.domain=ti(``),this.username=ti(``),this.appStore=I(eu),this.router=I(W$1),this.fb=I(dh),this.authService=I(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=BD({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=Sw();Pi(0,`nav`,3)(1,`h2`,4),gb(2,`Choose Barcode Mode`),fl(),Pi(3,`div`,5)(4,`button`,6),Lh(5,`i`,7),fl(),Pi(6,`ul`,8)(7,`li`,9)(8,`span`,10),gb(9,`User Profile`),fl()(),Pi(10,`li`,11)(11,`div`,12),Lh(12,`i`,13),fl(),Pi(13,`div`)(14,`h6`,14),gb(15),fl(),Pi(16,`h6`,15)(17,`a`,16),gb(18),fl()()()(),Pi(19,`li`),Lh(20,`hr`,17),fl(),Pi(21,`li`)(22,`button`,18),Uh(`click`,function(){return o.authService.logout()}),gb(23,` SIGN OUT `),fl()()()()(),Pi(24,`div`,19)(25,`main`,20)(26,`div`,21),yw(27,W,2,0,`h4`),yw(28,X,2,0,`h4`),yw(29,Y,2,0,`h4`),fl(),Pi(30,`div`,22)(31,`input`,23,0),KI(),fl(),Pi(33,`input`,24,1),KI(),fl(),Pi(35,`input`,24,2),KI(),fl(),Pi(37,`div`,25)(38,`div`,26)(39,`div`,27),Uh(`click`,function(){Qu(E);let M=Ww(32);return Zu(M.click())}),Pi(40,`div`,28)(41,`div`,29),Lh(42,`i`,30),fl(),Pi(43,`h6`,31),gb(44,`Print`),fl(),Pi(45,`h4`,32),gb(46,`Product`),fl()()(),Pi(47,`div`,27),Uh(`click`,function(){Qu(E);let M=Ww(34);return Zu(M.click())}),Pi(48,`div`,28)(49,`div`,29),Lh(50,`i`,33),fl(),Pi(51,`h6`,31),gb(52,`Print`),fl(),Pi(53,`h4`,32),gb(54,`Shelf`),fl()()(),yw(55,Z,8,3,`div`,34),fl(),Pi(56,`div`,35)(57,`input`,36),KI(),fl(),Pi(58,`label`,37),gb(59,`Remember my decision`),fl()(),Pi(60,`div`,38)(61,`button`,39),Uh(`click`,function(){return o.onNext()}),gb(62,` Next `),fl()()()()()()}s&2&&(uI(15),ug(o.username()),uI(2),kh(`href`,`https://`+o.domain(),np),uI(),ml(` `,o.domain(),` `),uI(9),Ew(o.form.get(`printMode`).value===1?27:-1),uI(),Ew(o.form.get(`printMode`).value===2?28:-1),uI(),Ew(o.form.get(`printMode`).value===3?29:-1),uI(),kh(`formGroup`,o.form),uI(),kh(`value`,1),XI(),uI(2),kh(`value`,2),XI(),uI(2),kh(`value`,3),XI(),uI(4),kh(`ngClass`,Nb(13,P,o.form.get(`printMode`).value===1)),uI(8),kh(`ngClass`,Nb(15,P,o.form.get(`printMode`).value===2)),uI(8),Ew(o.isUserAdmin?55:-1),uI(2),XI())},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};