1import{i as C,a4 as x,W as y,Q as d,X as v,j as N,G as S,aa as w,q as s,F as c,Y as h,H as p,K as m,u,Z as k,a0 as g,J as _,a6 as T,a7 as L,aj as P}from"./index-DUrPV9Cf.js";import{H as z}from"./header.component-xMILluNC.js";import{L as F}from"./linkTeaserTile.component-BvAlKWAU.js";import{L as B}from"./linkTile.component-BYh7JeC7.js";import{P as O}from"./pageHeading.component-C55WtJLZ.js";import{S as j}from"./spinner.component-BRdyh3b_.js";import"./button.component-CXGXoxGb.js";import"./dateTimestampProvider-CV0dHcg-.js";import"./tile-style.directive-Y8mo6lDy.js";const H=n=>({ik:n}),I=(n,e)=>e.ikNumber;function K(n,e){n&1&&(c(0,"div",1),s(1,"app-spinner"),p())}function D(n,e){if(n&1&&s(0,"app-link-tile",5),n&2){const t=e.$implicit;u("label","IK "+t.ikNumber)("text",t.contractPartner)("href","/additional-order")("queryParams",P(6,H,t.ikNumber))("size","medium")("color","secondary")}}function q(n,e){if(n&1&&(c(0,"app-heading",3),_(1," Bestellung basierend auf Institutionskennzeichen "),p(),c(2,"p",4),_(3," Wählen Sie ein vorhandenes Institutionskennzeichen aus, um eine Bestellung mit bereits hinterlegten Daten zu erstellen. "),p(),T(4,D,1,8,"app-link-tile",5,I)),n&2){const t=g(2);u("tag","h2")("size","medium"),m(4),L(t.institutions())}}function E(n,e){if(n&1&&(s(0,"app-link-teaser-tile",2),h(1,q,6,2)),n&2){const t=g();u("label","Für neue IK bestellen")("text","Erstellen Sie eine komplett neue Bestellung ohne vorhandene Daten")("href","/order")("title","Neue Bestellung starten"),m(),k(t.institutions().length>0?1:-1)}}const a=class a{constructor(){this.payloadService=C(x),this.orders=y(null),this.isLoading=d(()=>this.orders()===null),this.institutions=d(()=>{const e=this.orders();if(!e)return[];const t=e.docs??[],o=new Map;return t.forEach(r=>{const i=typeof r.customer=="object"?r.customer:null;if(!i)return;const l=r.ikNumber?.toString()||i.ikNumber?.toString();if(!l)return;const b=i.contractPartner||"Unbekannter Kunde";o.has(l)||o.set(l,{ikNumber:l,contractPartner:b,customer:i})}),Array.from(o.values()).sort((r,i)=>r.ikNumber.localeCompare(i.ikNumber))}),this.loadOrders()}async loadOrders(){try{const e=await v(this.payloadService.getOrders());this.orders.set(e)}catch(e){console.error("Failed to load orders:",e),this.orders.set({docs:[]})}}};a.ɵfac=function(t){return new(t||a)},a.ɵcmp=N({type:a,selectors:[["app-new-order"]],decls:6,vars:4,consts:[[1,"col-span-full",3,"title","showBack","backLink"],[1,"col-span-full","flex","min-h-[30vh]","items-center","justify-center"],[1,"col-span-full",3,"label","text","href","title"],[1,"col-span-full","mt-12",3,"tag","size"],[1,"col-span-full","text-neutral-600"],[1,"col-span-full","md:col-span-6",3,"label","text","href","queryParams","size","color"]],template:function(t,o){t&1&&(s(0,"app-header"),c(1,"div")(2,"app-grid"),s(3,"app-page-heading",0),h(4,K,2,0,"div",1)(5,E,2,5),p()()),t&2&&(m(3),u("title","Wählen Sie aus, für welche IK Sie bestellen möchten")("showBack",!0)("backLink","/portal"),m(),k(o.isLoading()?4:5))},dependencies:[S,z,w,B,O,j,F],encapsulation:2});let f=a;export{f as default};
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.