PageSourceSearch

https://www.smartcms.ai/_next/static/chunks/app/%5Blocale%5D/admin/access-requests/page-22c0e7bf9132afbf.js

js smartcms.ai collected 2026-10-05 15:00:40 UTC 15,168 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2221],{14294:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(12115);let s=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,n.forwardRef)((e,t)=>{let{color:a="currentColor",size:i=24,strokeWidth:l=2,absoluteStrokeWidth:d,className:c="",children:o,iconNode:u,...h}=e;return(0,n.createElement)("svg",{ref:t,...r,width:i,height:i,stroke:a,strokeWidth:d?24*Number(l)/Number(i):l,className:s("lucide",c),...h},[...u.map(e=>{let[t,a]=e;return(0,n.createElement)(t,a)}),...Array.isArray(o)?o:[o]])}),l=(e,t)=>{let a=(0,n.forwardRef)((a,r)=>{let{className:l,...d}=a;return(0,n.createElement)(i,{ref:r,iconNode:t,className:s("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),l),...d})});return a.displayName="".concat(e),a}},22649:(e,t,a)=>{"use strict";a.d(t,{F5:()=>s,Nj:()=>i,y2:()=>l});var n=a(15653);let s=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO"],r=e=>n.z.string().trim().min(1).max(e).regex(/^[^\x00-\x1f\x7f]+$/),i=n.z.object({legalName:r(200),country:n.z.enum(s),streetAddress:r(200),postalCode:r(20),city:r(100),vatId:n.z.string().trim().max(40).regex(/^[A-Za-z0-9 .-]*$/),businessUseConfirmed:n.z.literal(!0),authorityConfirmed:n.z.literal(!0)}).strict(),l=r(1e3).min(10)},26615:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(14294).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},60931:(e,t,a)=>{"use strict";a.d(t,{W9:()=>r,pI:()=>s});var n=a(95155);a(52619);let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat("de-DE"===e?"/de-DE":"","/admin").concat(t)};function r(e){let{eyebrow:t,title:a,description:s}=e;return(0,n.jsxs)("header",{className:"a-heading",children:[(0,n.jsx)("span",{children:t}),(0,n.jsx)("h1",{children:a}),(0,n.jsx)("p",{children:s})]})}},72251:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(14294).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},90506:(e,t,a)=>{"use strict";a.d(t,{AccessRequestsPanel:()=>h});var n=a(95155),s=a(12115),r=a(14294);let i=(0,r.A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),l=(0,r.A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);var d=a(26615),c=a(72251),o=a(60931),u=a(22649);function h(e){let{locale:t,initialQuery:a="",initialStatus:r=""}=e,h=(e,a)=>
1"de-DE"===t?e:a,[g,m]=(0,s.useState)(a),[b,x]=(0,s.useState)(a),[f,p]=(0,s.useState)(r),v=(0,s.useRef)(null);(0,s.useEffect)(()=>{m(a),x(a),p(r),N(0)},[a,r]);let[k,w]=(0,s.useState)([]),[y,N]=(0,s.useState)(0),[j,E]=(0,s.useState)(!1),[A,D]=(0,s.useState)(!0),[S,C]=(0,s.useState)(null),[I,R]=(0,s.useState)(""),[T,L]=(0,s.useState)(""),[z,V]=(0,s.useState)({}),B=(0,s.useCallback)(async()=>{var e;null==(e=v.current)||e.abort();let a=new AbortController;v.current=a,D(!0);try{let e=await fetch("/api/admin/access-requests?offset=".concat(y,"&q=").concat(encodeURIComponent(g),"&status=").concat(encodeURIComponent(f)),{cache:"no-store",signal:a.signal});if(!e.ok)throw Error("load_failed");let t=await e.json();if(a.signal.aborted)return;w(t.applications),E(t.hasMore),R("")}catch(e){if(a.signal.aborted)return;R("de-DE"===t?"Anfragen konnten nicht geladen werden. Bitte erneut versuchen.":"Could not load requests. Please retry.")}finally{a.signal.aborted||D(!1)}},[y,t,g,f]);async function q(e,t){if(!S&&("delete"!==t||window.confirm(h("Anfrage und Verlauf endg\xfcltig l\xf6schen? Das Konto und seine Organisation bleiben bestehen.","Permanently delete the request and history? The account and organization remain.")))){C(e.id),R(""),L("");try{var a,n;let s=await fetch("/api/admin/access-requests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,revision:e.revision,action:t,..."invite"===t?{businessReviewNote:null!=(n=null!=(a=z[e.id])?a:e.businessReviewNote)?n:""}:{}})});if(!s.ok)throw await B(),Error(409===s.status?"changed":"failed");let r=await s.json();L("failed"===r.invitationStatus?h("Freigabe gespeichert, Mailversand nicht best\xe4tigt. Bitte Einladung erneut senden. Ein vorheriger Link ist ung\xfcltig.","Approval saved, email delivery unconfirmed. Please resend the invitation. Any previous link is invalid."):"invite"===t?h("Einladung vom E-Mail-Dienst angenommen. G\xfcltig f\xfcr 7 Tage.","Invitation accepted by the email provider. Valid for 7 days."):h("Status gespeichert. Es wurde keine E-Mail versendet.","Status saved. No email was sent.")),await B()}catch(e){R(e instanceof Error&&"changed"===e.message?h("Der Stand wurde zwischenzeitlich ge\xe4ndert. Bitte die aktualisierte Anfrage pr\xfcfen.","The request has changed. Please review the refreshed data."):h("Aktion nicht best\xe4tigt. Bitte neu laden und den Status pr\xfcfen, bevor du es erneut versuchst.","Action unconfirmed. Refresh and check the status before retrying."))}finally{C(null)}}}(0,s.useEffect)(()=>(B(),()=>{var e;return null==(e=v.current)?void 0:e.abort()}),[B]);let M={NEW:h("Neu","New"),INVITED:h("Eingeladen","Invited"),ACTIVATED:h("Aktiviert","Activated"),DECLINED:h("Abgelehnt","Declined"),REVOKED:h("Widerrufen","Revoked")},P={reopen:h("Erneut ge\xf6ffnet","Reopened"),requested_again:h("Erneut angefragt","Requested again"),requested:h("Angefragt","Requested"),approved:h("Freigegeben","Approved"),invitation_renewed:h("Link erneuert","Link renewed"),invitation_sent:h("Mail angenommen","Email accepted"),invitation_send_unconfirmed:h("Mail nicht best\xe4tigt","Email unconfirmed"),decline:h("Abgelehnt","Declined"),revoke:h("Widerrufen","Revoked"),activated:h("Organisation angelegt","Organization created")},O="inline-flex min-h-11 items-center justify-center gap-2 rounded-md border border-gray-300 px-3 py-2 text-sm hover:bg-gray-100 disabled:opacity-50 dark:border-gray-600 dark:hover:bg-gray-700";return(0,n.jsxs)("main",{className:"a-page",children:[(0,n.jsxs)("div",{className:"mb-6 flex flex-wrap items-start justify-between gap-4",children:[(0,n.jsx)(o.W9,{eyebrow:h("Zugangsverwaltung","Access management"),title:h("Zugangsanfragen","Access requests"),description:h("Pr\xfcfe das Vorhaben und lade neue Kunden ein. Erst bei Annahme entstehen ihre eigene Organisation und der erste Space. Bestehende Teammitglieder l\xe4dst du weiterhin im Space ein.","Review each request and invite new customers. Their organization and first space are created only when they accept. Invite existing team members through their space.")}),(0,n.jsxs)("button",{className:O,disabled:A||!!S,onClick:()=>void B(),children:[(0,n.jsx)(i,{size:16}),h("Aktualisieren","Refresh")]})]}),(0,n.jsxs)("form",{className:"a-search",onSubmit:e=>{e.preventDefault(),m(b.trim()),N(0)},children:[(0,n.jsxs)("label",{children:[h("Anfrage suchen","Find request"),(0,n.jsx)("input",{disabled:!!S,value:b,onChange:e=>x(e.target.value),maxLength:100,placeholder:h("Name, E-Mail oder Vorhaben","Name, email or project")})]}),(0,n.jsxs)("label",{children:[h("Status filtern","Filter by status"),(0,n.jsxs)("select",{disabled:!!S,value:f,onChange:e=>{p(e.target.value),N(0)},children:[(0,n.jsx)("option",{value:"",children:h("Alle Anfragen","All requests")}),Object.entries(M).map(e=>
1{let[t,a]=e;return(0,n.jsx)("option",{value:t,children:a},t)}),(0,n.jsx)("option",{value:"MAIL",children:h("Mailversand unbest\xe4tigt","Unconfirmed email")}),(0,n.jsx)("option",{value:"EXPIRED",children:h("Einladung abgelaufen","Expired invitation")})]})]}),(0,n.jsx)("button",{type:"submit",disabled:!!S,children:h("Suchen","Search")})]}),I&&(0,n.jsx)("p",{role:"alert",className:"mb-4 rounded-md bg-red-50 p-4 text-sm text-red-800 dark:bg-red-950 dark:text-red-200",children:I}),T&&(0,n.jsx)("p",{role:"status",className:"mb-4 rounded-md bg-blue-50 p-4 text-sm text-blue-900 dark:bg-blue-950 dark:text-blue-100",children:T}),A&&(0,n.jsx)("p",{role:"status",children:h("Anfragen werden geladen…","Loading requests…")}),!A&&!I&&!k.length&&(0,n.jsx)("p",{className:"rounded-lg border border-dashed border-gray-300 p-8 text-gray-600 dark:border-gray-600 dark:text-gray-300",children:h("Keine passenden Zugangsanfragen.","No matching access requests.")}),(0,n.jsx)("div",{className:"space-y-4",children:k.map(e=>{var a,s;let r=u.Nj.safeParse(e.businessProfile),i=r.success?r.data:null,o=null!=(s=null!=(a=z[e.id])?a:e.businessReviewNote)?s:"";return(0,n.jsxs)("article",{className:"rounded-lg border border-gray-200 bg-white p-5 dark:border-gray-700 dark:bg-gray-800",children:[(0,n.jsxs)("div",{className:"flex flex-wrap justify-between gap-4",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h2",{className:"break-words text-lg font-semibold",children:e.name}),(0,n.jsx)("a",{className:"break-all text-sm text-blue-700 underline dark:text-blue-300",href:"mailto:".concat(e.email),children:e.email}),(0,n.jsxs)("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:[new Date(e.createdAt).toLocaleString(t)," \xb7"," ",e.locale]})]}),(0,n.jsx)("span",{className:"h-fit rounded-full bg-gray-100 px-3 py-1 text-sm dark:bg-gray-700",children:M[e.status]||e.status})]}),(0,n.jsx)("p",{className:"my-4 whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.message}),i?(0,n.jsxs)("div",{className:"mb-4 space-y-1 break-words text-sm",children:[(0,n.jsx)("p",{className:"font-semibold",children:i.legalName}),(0,n.jsxs)("p",{children:[i.streetAddress,", ",i.postalCode," ",i.city," \xb7 ",i.country]}),(0,n.jsxs)("p",{children:[h("USt-ID / P.IVA","VAT ID"),":"," ",i.vatId||h("Nicht angegeben – alternativen Nachweis pr\xfcfen","Not provided – verify alternative evidence")]}),(0,n.jsx)("p",{children:h("Gesch\xe4ftliche Nutzung und Vertretungsbefugnis vom Antragsteller best\xe4tigt.","Applicant confirmed business use and authority to act.")})]}):(0,n.jsx)("p",{className:"mb-4 text-sm text-amber-800 dark:text-amber-200",children:"ACTIVATED"===e.status?h("Bestandskonto ohne neue B2B-Pr\xfcfung; bestehender Zugang bleibt unver\xe4ndert.","Existing account without the new B2B review; existing access is unchanged."):h("B2B-Angaben fehlen. Vor einer Einladung die Anfrage ablehnen bzw. widerrufen und den Kunden bitten, das aktuelle Formular erneut auszuf\xfcllen.","Business details are missing. Before inviting, decline or revoke the request and ask the customer to submit the current form again.")}),"ACTIVATED"!==e.status&&i&&(0,n.jsxs)("label",{className:"mb-4 block text-sm",htmlFor:"business-review-".concat(e.id),children:[h("Pr\xfcfvermerk: Gesch\xe4ftst\xe4tigkeit, EU/EWR-Sitz und Vertretung gepr\xfcft","Review note: verified business activity, EU/EEA location and authority"),(0,n.jsx)("textarea",{id:"business-review-".concat(e.id),className:"mt-2 block w-full rounded border border-gray-300 bg-transparent p-2 dark:border-gray-600",rows:2,maxLength:1e3,disabled:!!S,value:o,onChange:t=>V(a=>({...a,[e.id]:t.target.value}))}),(0,n.jsx)("span",{className:"text-xs",children:h("Kurzer Nachweisvermerk (mindestens 10 Zeichen), keine sensiblen Dokumentinhalte.","Brief evidence note (at least 10 characters), no sensitive document contents.")})]}),"ACTIVATED"===e.status&&e.businessReviewNote&&(0,n.jsxs)("p",{className:"mb-4 break-words text-sm",children:[h("B2B-Pr\xfcfung","Business review"),":"," ",e.businessReviewNote]}),"INVITED"===e.status&&(0,n.jsxs)("p",{className:"mb-3 text-sm text-gray-600 dark:text-gray-300",children:[e.expiresAt&&new Date(e.expiresAt)<new Date?h("Link abgelaufen. Erneut senden erzeugt einen neuen Link.","Link expired. Resend to create a new link."):"".concat(h("Link g\xfcltig bis","Link valid until")," ").concat(e.expiresAt?new Date(e.expiresAt).toLocaleStr
1ing(t):"—")," \xb7 ","sent"===e.invitationStatus?h("Mail angenommen","Email accepted"):"failed"===e.invitationStatus?h("Mailversand nicht best\xe4tigt","Email unconfirmed"):h("Versand l\xe4uft / noch nicht best\xe4tigt","Sending / not yet confirmed")]}),"failed"===e.notificationStatus&&(0,n.jsx)("p",{className:"mb-3 text-xs text-amber-800 dark:text-amber-200",children:h("Die Benachrichtigung an [email protected] wurde nicht best\xe4tigt. Die Anfrage ist gespeichert.","The notification to [email protected] was not confirmed. The request is saved.")}),"ACTIVATED"!==e.status&&(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsxs)("button",{className:"".concat(O," bg-blue-700 text-white hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700"),disabled:!!S||!i||!u.y2.safeParse(o).success,onClick:()=>void q(e,"invite"),children:[(0,n.jsx)(l,{size:16}),"INVITED"===e.status?h("Einladung erneut senden","Resend invitation"):h("Freigeben und einladen","Approve and invite")]}),"INVITED"===e.status?(0,n.jsxs)("button",{className:O,disabled:!!S,onClick:()=>void q(e,"revoke"),children:[(0,n.jsx)(d.A,{size:16}),h("Einladung widerrufen","Revoke invitation")]}):"DECLINED"!==e.status&&(0,n.jsx)("button",{className:O,disabled:!!S,onClick:()=>void q(e,"decline"),children:h("Ablehnen","Decline")})]}),"ACTIVATED"===e.status&&(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm text-green-800 dark:text-green-200",children:[(0,n.jsx)(c.A,{size:16}),h("Organisation und erster Space eingerichtet.","Organization and first space created.")]}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[["DECLINED","REVOKED"].includes(e.status)&&(0,n.jsx)("button",{className:O,disabled:!!S,onClick:()=>void q(e,"reopen"),children:h("Erneut \xf6ffnen","Reopen")}),(0,n.jsx)("button",{className:O,disabled:!!S,onClick:()=>void q(e,"delete"),children:h("Anfrage l\xf6schen","Delete request")})]}),(0,n.jsxs)("details",{className:"mt-4 border-t border-gray-200 pt-3 text-xs text-gray-600 dark:border-gray-700 dark:text-gray-300",children:[(0,n.jsx)("summary",{className:"cursor-pointer py-2",children:h("Verlauf","History")}),(0,n.jsx)("ul",{className:"space-y-2 pt-2",children:e.events.map(e=>(0,n.jsxs)("li",{className:"break-words",children:[new Date(e.createdAt).toLocaleString(t)," \xb7"," ",P[e.action]||e.action," \xb7 ",e.actor]},e.id))})]})]},e.id)})}),(0,n.jsxs)("div",{className:"mt-6 flex items-center gap-4",children:[(0,n.jsx)("button",{className:O,disabled:0===y||A||!!S,onClick:()=>N(Math.max(0,y-50)),children:h("Zur\xfcck","Previous")}),(0,n.jsxs)("span",{className:"text-sm",children:[h("Seite","Page")," ",y/50+1]}),(0,n.jsx)("button",{className:O,disabled:!j||A||!!S,onClick:()=>N(y+50),children:h("Weiter","Next")})]})]})}},94292:(e,t,a)=>{Promise.resolve().then(a.bind(a,90506))}},e=>{e.O(0,[2619,5653,8441,4696,7358],()=>e(e.s=94292)),_N_E=e.O()}]);

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.