1import{a as ae,b as le,c as ce,d as de}from"./chunk-IDBYNTOO.js";import{C as re,E as se,e as ie,ga as me,h,y as ne,z as oe}from"./chunk-4KQZIYN5.js";import"./chunk-YULL2WLA.js";import"./chunk-D7EE7E6W.js";import"./chunk-EQ5CQLSI.js";import"./chunk-QASUSEMK.js";import{Ib as te,d as W,ib as ee,j as K}from"./chunk-OHGDOQ4W.js";import"./chunk-WVUMCZ6E.js";import"./chunk-2IDUPOBL.js";import"./chunk-KA2JSYKK.js";import{Z as J,ea as Y,m as $}from"./chunk-FFIE3C6U.js";import{$ as v,$a as s,Ba as H,Bb as z,Cb as j,Cc as F,Ea as r,Ga as A,Gc as Q,Ia as E,Ic as Z,Ja as O,Kc as U,Nc as G,O as g,U as M,Ua as L,Ub as b,Va as m,Vb as w,Wa as u,_ as f,_a as y,_c as X,ab as l,ad as D,bb as c,ec as q,ga as x,i as T,ib as C,kb as B,mb as d,qb as P,rb as S,sb as _,ua as k,uc as V,wb as R,ya as a,zc as N}from"./chunk-J2RHNESS.js";var Se=["htmlTemplate"],_e=["orderDetailMenu"];function be(n,p){if(n&1&&c(0,"app-configurator-wizard",9),n&2){let e=d(2);y("showOrderTypeSelector",!e.orderTypeSelected)}}function we(n,p){n&1&&(s(0,"div",10),c(1,"mat-icon",11),s(2,"p",12),z(3),b(4,"translate"),l()()),n&2&&(a(3),j(w(4,1,"alert.initializing_error")))}function De(n,p){if(n&1){let e=C();s(0,"div",4)(1,"button",7),b(2,"translate"),B("click",function(){f(e);let i=d();return v(i.onCloseMenu())}),c(3,"mat-icon",8),l(),m(4,be,1,1,"app-configurator-wizard",9)(5,we,5,3,"div",10),l()}if(n&2){let e=d();a(),L("aria-label",w(2,2,"feedback.close")),a(3),u(e.errorInitializingGlobalSettings?5:4)}}function Ie(n,p){if(n&1&&c(0,"div",6,1),n&2){let e=d();y("innerHtml",e.htmlData,k)}}var ue=(()=>{class n{get htmlData(){return this._htmlData}set htmlData(e){this._htmlData=e}constructor(e,t,i,o,I,he,pe,ge,fe,ve,ye,Ce){this.sanitizer=e,this.http=t,this.router=i,this.route=o,this.lookupService=I,this.ngZone=he,this.authService=pe,this.dialog=ge,this.settingsService=fe,this.viewContainerRef=ve,this.componentFactoryResolver=ye,this.cdr=Ce,this._unsubscribe=new T,this.orderTypeSelected=void 0,this.initialized=!1,this.globalSettingsInitialized=!1,this.errorInitializingGlobalSettings=!1,this.userName="",this.baseUrl=D.homeTemplateUrl}ngOnInit(){this.authService.init(),console.log(this.baseUrl),this.loadPage(""),this.authService.authData.pipe(g(this._unsubscribe)).subscribe(e=>{this.userName=e?.FirstName||"",e?this.onLoggedIn():this.onLoggedOut()})}ngAfterViewChecked(){!this.initialized&&this.htmlTemplate&&(this.initialized=!0,this.onHtmlDataChanged())}ngOnDestroy(){this._unsubscribe.next(),this._unsubscribe.complete();for(let e=0;e<this.loginButtons.length;e++)this.loginButtons[e].removeEventListener("click",t=>this.onLogin);for(let e=0;e<this.registerButtons.length;e++)this.registerButtons[e].removeEventListener("click",t=>this.onRegister);for(let e=0;e<this.orderTypeButtons.length;e++)this.orderTypeButtons[e].removeEventListener("click",t=>this.onOrderTypeSelected(e));for(let e=0;e<this.itemsButtons.length;e++)this.itemsButtons[e].removeEventListener("click",t=>this.onItemSelected(e));this.accountDropdownComponentInstance&&this.accountDropdownComponentInstance.destroy()}loadPage(e){let t=new N().set("Content-Type","text/plain; charset=utf-8");e.startsWith("/")||(e="/"+e),this.http.get(this.baseUrl+e+"?"+new Date().getTime(),{headers:t,responseType:"text"}).pipe(g(this._unsubscribe)).subscribe(i=>{let o=this.fixRelativeUrls(i,this.baseUrl);this.htmlData=this.sanitizer.bypassSecurityTrustHtml(o),this.cdr.detectChanges(),this.addNavigationHandler(),this.onHtmlDataChanged()},i=>{i.status===404&&(this.lookupService.locationGuid.getValue()?this.router.navigate([e],{queryParamsHandling:"merge"}):(this.lookupService.setNavigateToOnUpdateUrl(e.replace("/","")),this.ngZone.run(()=>{this.openOrderDetailMenu()})))})}fixRelativeUrls(e,t){let i=/(src|href)="\/([^"]+)"/g;return e.replace(i,`$1="${t}/$2"`)}addNavigationHandler(){window.navigateToPage=e=>{this.loadPage(e)}}onHtmlDataChanged(){if(document.getElementById("appVersion")&&(document.getElementById("appVersion").innerText=D.version),this.userMenu=document.getElementById("userMenu"),this.loginButtons=document.querySelectorAll('[id="login"]'),this.loginButtons)for(let e=0;e<this.loginButtons.length;e++)this.loginButtons[e].addEventListener("click",t=>this.onLogin());if(this.registerButtons=document.querySelectorAll('[id="register"]'),this.registerButtons)for(let e=0;e<this.registerButtons.length;e++)this.registerButtons[e].addEventListener("click",t=>this.onRegister());if(this.userName?this.onLoggedIn():this.onLoggedOut(),this.orderTypeButtons=document.querySelectorAll('[role="button"][orderType]'),this.orderTypeButtons)for(let e=0;e<this.orderTypeButtons.length;e++)this.orderTypeButtons[e].addEventListener("click",t=>this.onOrderTypeSelected(e));if(this.itemsButtons=document.querySelectorAll('[role="button"][itemId]'),this.itemsButtons)for(let e=0;e<this.itemsButtons.length;e++)this.itemsButtons[e].addEventListener("click",t=>this.onItemSelected(e));if(this.discountsButtons=document.querySelectorAll('[role="button"][discountId]'),this.discountsButtons)for(let e=0;e<this.discountsButtons.length;e++)this.discountsButtons[e].addEventListener("click",t=>this.onDiscountSelected(e));if(this.templatesButtons=document.querySelectorAll('[role="button"][templateId]'),this.templatesButtons)for(let e=0;e<this.templatesButtons.length;e++)this.templatesButtons[e].addEventListener("click",t=>this.onTemplateSelected(e))}openOrderDetailMenu(){this.globalSettingsInitialized?this.orderDetailMenu.open():this.settingsService.init().then(()=>this.globalSettingsInitialized=!0).catch(e=>this.errorInitializingGlobalSettings=!0).finally(()=>this.orderDetailMenu.open())}onOrderTypeSelected(e){let t=this.orderTypeButtons[e];this.orderTypeButtons.forEach(i=>
1i.removeAttribute("selected")),t.setAttribute("selected",""),this.orderTypeSelected=t.getAttribute("orderType"),this.lookupService.setOrderType(this.orderTypeSelected,!1)}onItemSelected(e){let t=this.itemsButtons[e];this.itemsButtons.forEach(o=>o.removeAttribute("selected")),t.setAttribute("selected","");let i=t.getAttribute("itemId");i&&(this.openOrderDetailMenu(),this.ngZone.run(()=>{this.router.navigate([],{relativeTo:this.route,queryParams:{itemId:i},queryParamsHandling:"merge"})}))}onDiscountSelected(e){let t=this.discountsButtons[e];this.discountsButtons.forEach(o=>o.removeAttribute("selected")),t.setAttribute("selected","");let i=t.getAttribute("discountId");i&&(this.openOrderDetailMenu(),this.ngZone.run(()=>{this.router.navigate([],{relativeTo:this.route,queryParams:{discountId:i},queryParamsHandling:"merge"})}))}onTemplateSelected(e){let t=this.templatesButtons[e];this.templatesButtons.forEach(o=>o.removeAttribute("selected")),t.setAttribute("selected","");let i=t.getAttribute("templateId");i&&(this.openOrderDetailMenu(),this.ngZone.run(()=>{this.router.navigate([],{relativeTo:this.route,queryParams:{category:i},queryParamsHandling:"merge"})}))}unselectAll(){this.orderTypeButtons.forEach(e=>e.removeAttribute("selected")),this.orderTypeSelected=void 0,this.itemsButtons.forEach(e=>e.removeAttribute("selected"))}onCloseMenu(){this.lookupService.removeQueryParam("itemId"),this.lookupService.clear(),this.unselectAll(),this.orderDetailMenu.close()}onLogin(){this.dialog.open(oe,{autoFocus:!1,panelClass:["default-dialog"]})}onRegister(){this.dialog.open(ne,{autoFocus:!1,panelClass:["default-dialog-full"]})}onLoggedIn(){if(this.loginButtons)for(let e=0;e<this.loginButtons.length;e++)this.loginButtons[e].style.display="none";if(this.registerButtons)for(let e=0;e<this.registerButtons.length;e++)this.registerButtons[e].style.display="none";if(this.userMenu){this.userMenu.style.display="inline";let e=this.componentFactoryResolver.resolveComponentFactory(re);this.accountDropdownComponentInstance=this.viewContainerRef.createComponent(e),this.accountDropdownComponentInstance.instance.isWelcomeHeader=!0,this.accountDropdownComponentInstance.instance.userName=this.userName;let t=this.accountDropdownComponentInstance.location.nativeElement;this.userMenu.appendChild(t)}}onLoggedOut(){if(this.loginButtons)for(let e=0;e<this.loginButtons.length;e++)this.loginButtons[e].style.display="inline";if(this.registerButtons)for(let e=0;e<this.registerButtons.length;e++)this.registerButtons[e].style.display="inline";this.userMenu&&(this.userMenu.style.display="none")}onChange(){}static{this.\u0275fac=function(t){return new(t||n)(r(Q),r(F),r(U),r(Z),r(ee),r(x),r(te),r(J),r(W),r(A),r(H),r(q))}}static{this.\u0275cmp=E({type:n,selectors:[["app-dynamic-home"]],viewQuery:function(t,i){if(t&1&&P(Se,5)(_e,5),t&2){let o;S(o=_())&&(i.htmlTemplate=o.first),S(o=_())&&(i.orderDetailMenu=o.first)}},standalone:!1,decls:6,vars:2,consts:[["orderDetailMenu",""],["htmlTemplate",""],[1,"drawer-container",3,"backdropClick"],["mode","over","position","end"],[1,"flex","flex-col","p-1"],[1,"drawer-content"],["appRunScripts","",3,"innerHtml"],["mat-icon-button","",1,"self-end",3,"click"],["svgIcon","Close",1,"close-icon"],[3,"showOrderTypeSelector"],[1,"flex","flex-col","space-y-2","p-10","mx-auto"],["color","primary","svgIcon","AlertTriangle",1,"alert-icon"],[1,"text-lg"]],template:function(t,i){if(t&1){let o=C();s(0,"mat-drawer-container",2),B("backdropClick",function(){return f(o),v(i.onCloseMenu())}),s(1,"mat-drawer",3,0),m(3,De,6,4,"div",4),l(),s(4,"mat-drawer-content",5),m(5,Ie,2,1,"div",6),l()()}if(t&2){let o=R(2);a(3),u(o.opened?3:-1),a(2),u(i.htmlData?5:-1)}},dependencies:[Y,K,se,le,ce,ae,h,X],styles:[".drawer-container[_ngcontent-%COMP%]{width:100vw;height:100dvh!important}.drawer-content[_ngcontent-%COMP%]{overflow-y:scroll!important;height:100dvh!important}.alert-icon[_ngcontent-%COMP%]{width:42px;height:auto;margin:auto}.drawer-container[_ngcontent-%COMP%] mat-drawer[_ngcontent-%COMP%]{width:40rem}@media(max-width:599px){.drawer-container[_ngcontent-%COMP%] mat-drawer[_ngcontent-%COMP%]{width:100%}}"]})}}return n})();var Te=[{path:"",component:ue}],nt=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=O({type:n})}static{this.\u0275inj=M({imports:[V,G.forChild(Te),me,de,ie,$,h]})}}return n})();export{nt as DynamicHomeModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.