import{a}from"./chunk-XQ4T7T2G.js";import{a as U}from"./chunk-FAZDIGO2.js";import"./chunk-CVN2SFTO.js";import{b as T,d as G}from"./chunk-NWQ7TT3N.js";import"./chunk-JEJK4HLJ.js";import"./chunk-MLDEIZ4D.js";import"./chunk-BOGTXGHD.js";import"./chunk-FIGHW4X4.js";import"./chunk-W3A2JYYI.js";import{b as m,c as V}from"./chunk-W47YR7MY.js";import"./chunk-Y34C7AHI.js";import{n as D}from"./chunk-CUASPFRX.js";import{V as P}from"./chunk-HLHVLECB.js";import{w as L,x as k}from"./chunk-6IEN3EM2.js";import"./chunk-P5KJQMC2.js";import"./chunk-HCYBOTNG.js";import{g as j}from"./chunk-V47ENDL4.js";import"./chunk-S5VNTSUD.js";import{G as b,H as B,y as s,z as O}from"./chunk-PT2SMVM6.js";import"./chunk-H2CU6EEU.js";import"./chunk-GK2ZGAUD.js";import"./chunk-4TDNJBFX.js";import"./chunk-NUAVJ2U7.js";import"./chunk-KOATU5RH.js";import"./chunk-XWHKIKFV.js";import"./chunk-PBM4LEG7.js";import{i as w,j as y,k as n,p as R}from"./chunk-QVLAHW2O.js";import"./chunk-TI6NUUOB.js";import"./chunk-LYCHGZAM.js";import{A as l,G as p,Kb as I,Lb as C,Md as A,Ob as g,Sd as x,T as f,hc as F,ic as M,la as H,nd as c,qc as S,ra as h,va as v,wa as d,yb as o}from"./chunk-PGS4AHIT.js";x();k();c();var W=(()=>{class e extends U{constructor(t,i,r,u){super(),this.helpService=t,this.identsService=i,this.router=r,this.route=u}ngOnInit(){this.helpService.setHelpUrls({help:m.Idents,example:m.ExampleIdentsNew,video:""}),setTimeout(()=>{this.navigateToFirstIdent()},100)}navigateToFirstIdent(){this.route.firstChild!=null||this.identsService.getFirstIdent().subscribe({next:i=>{i?this.router.navigate(["idents-form",i,"basic-data"],{relativeTo:this.route}):(console.error("[Idents] No products found in database. Please create first product."),this.router.navigate(["idents-form","create","basic-data"],{relativeTo:this.route}))},error:i=>{console.error("[Idents] Error fetching first ident:",i),this.router.navigate(["idents-form","create","basic-data"],{relativeTo:this.route})}})}onActivate(t){this.currentChild=t}getViewActions(){return this.currentChild&&typeof this.currentChild.getViewActions=="function"?this.currentChild.getViewActions():[]}static{this.\u0275fac=function(i){return new(i||e)(o(V),o(a),o(n),o(w))}}static{this.\u0275cmp=I({type:e,selectors:[["paw-idents"]],standalone:!1,features:[g],decls:2,vars:0,consts:[[3,"activate"]],template:function(i,r){i&1&&(F(0,"paw-main-module-view")(1,"router-outlet",0),S("activate",function(N){return r.onActivate(N)}),M()())},dependencies:[T,y],encapsulation:2})}}return e})();c();H();var _=(e,z)=>{let t=d(n);return d(a).getFirstIdent().pipe(p(r=>(r?t.navigate(["/idents/idents-form",r,"basic-data"],{replaceUrl:!0}):t.navigate(["/idents/idents-form/create/basic-data"],{replaceUrl:!0}),!1)),f(()=>(t.navigate(["/idents/idents-form/create/basic-data"],{replaceUrl:!0}),l(!1))))};O();var E={"CodeLists.Products.Create":e=>e.hasStandardLicence([s.WP])&&!e.hasAnyGranule()&&e.canWrite("SIFART"),"CodeLists.Products.Update":e=>e.hasStandardLicence([s.WP])&&!e.hasAnyGranule()&&e.canWrite("SIFART"),"CodeLists.Products.Delete":e=>e.hasStandardLicence([s.WP])&&!e.hasAnyGranule()&&e.canDelete("SIFART")};c();B();var Ce=(()=>{class e{constructor(t){this.securityFeatureService=t,this.securityFeatureService.registerFeatures(E)}static{this.\u0275fac=function(i){return new(i||e)(v(b))}}static{this.\u0275mod=C({type:e})}static{this.\u0275inj=h({imports:[A,L,G,D,P,j,R.forChild([{path:"",component:W,children:[{path:"",canActivate:[_],children:[]},{path:"idents-main",loadChildren:()=>import("./chunk-DTYW7HC6.js").then(t=>t.IdentsMainModule)},{path:"idents-form",loadChildren:()=>import("./chunk-66ZZJMBU.js").then(t=>t.IdentsFormModule)},{path:"idents-form/:id",loadChildren:()=>import("./chunk-66ZZJMBU.js").then(t=>t.IdentsFormModule)}]}])]})}}return e})();export{Ce as IdentsModule};
