(function(){const a=window.KIND_REGISTRY||(window.KIND_REGISTRY={}),t={legal_name:"Meridian GmbH",trading_name:"AaaS",address_line_1:"Mustergasse 1",address_line_2:"",postcode:"10115",city:"Berlin",country:"DE",tax_id:"DE 123 456 789",iban:"DE12 3456 7890 1234 5678 90",bic:"DEUTDEFFXXX",bank_name:"Deutsche Bank",signatory:"Alex Rowan",invoice_prefix:"2026-",next_number:43,payment_terms_days:30,default_tax_rate:19,expense_categories:["Hosting","Email","Payments fees","LLM","Tools","Travel","Office"]},i=[{id:"cl-001",name:"AaaS",email:"demo-contact-redacted.company-x.example",address:"Mustergasse 1, 10115 Berlin",tax_id:"DE 999 888 777",created_at:"2026-04-18",invoices_count:3,outstanding:"290,00",lifetime:"1.740,00"},{id:"cl-002",name:"ACME GmbH",email:"demo-contact-redacted.company-x.example",address:"Hauptstra\xDFe 42, 80331 M\xFCnchen",tax_id:"DE 111 222 333",created_at:"2026-01-12",invoices_count:6,outstanding:"4.320,00",lifetime:"24.720,00"},{id:"cl-003",name:"BoutiqueX OG",email:"demo-contact-redacted.company-x.example",address:"Burgring 4, 1010 Wien",tax_id:"AT U 222 333 44",created_at:"2026-02-04",invoices_count:2,outstanding:"1.680,00",lifetime:"4.680,00"},{id:"cl-004",name:"KoruFM Ltd",email:"demo-contact-redacted.company-x.example",address:"15 Old Street, London EC1V 9HX",tax_id:"GB 444 5555 66",created_at:"2026-03-14",invoices_count:4,outstanding:"0,00",lifetime:"8.760,00"},{id:"cl-005",name:"Novadex GmbH",email:"demo-contact-redacted.company-x.example",address:"Friedrichstra\xDFe 100, 10117 Berlin",tax_id:"DE 555 666 777",created_at:"2026-04-02",invoices_count:5,outstanding:"0,00",lifetime:"12.480,00"},{id:"cl-006",name:"Acme Dynamics",email:"demo-contact-redacted.company-x.example",address:"Bavariaring 26, 80336 M\xFCnchen",tax_id:"DE 666 777 888",created_at:"2026-05-12",invoices_count:0,outstanding:"0,00",lifetime:"0,00"},{id:"cl-007",name:"Norddeutsche Bank",email:"demo-contact-redacted.company-x.example",address:"Jungfernstieg 30, 20354 Hamburg",tax_id:"DE 777 888 999",created_at:"2026-03-08",invoices_count:1,outstanding:"0,00",lifetime:"310,00"},{id:"cl-008",name:"TUM Spinoff e.V.",email:"demo-contact-redacted.company-x.example",address:"Arcisstra\xDFe 21, 80333 M\xFCnchen",tax_id:"DE 888 999 000",created_at:"2026-01-22",invoices_count:2,outstanding:"0,00",lifetime:"1.980,00"}],l=[{id:"inv-0042",invoice_number:"2026-0042",client_id:"cl-001",client_name:"AaaS",issue_date:"26.05.2026",due_date:"25.06.2026",delivery_date:"31.05.2026",net_total:"290,00",tax_total:"55,10",gross_total:"345,10",status:"PAID",statusLabel:"Paid",payment_terms_days:30,pdf_url:"#",notes:"Pro-rated for May; full \u20AC290 starting June.",created_at:"2026-05-26",line_items:[{description:"Pro subscription \u2013 May 2026",quantity:1,unit_price:"290,00",tax_rate:"19,00",total:"290,00"}],activity:[{ts:"26.05.2026 14:32",who:"demo-contact-redacted.company-x.example",verb:"Issued",note:""},{ts:"26.05.2026 14:33",who:"demo-contact-redacted.company-x.example",verb:"Sent to",note:"demo-contact-redacted.company-x.example"},{ts:"27.05.2026 09:15",who:"demo-contact-redacted.company-x.example",verb:"Marked",note:"PAID"}]},{id:"inv-0041",invoice_number:"2026-0041",client_id:"cl-002",client_name:"ACME GmbH",issue_date:"24.05.2026",due_date:"23.06.2026",delivery_date:"24.05.2026",net_total:"4.320,00",tax_total:"820,80",gross_total:"5.140,80",status:"ISSUED",statusLabel:"Issued",payment_terms_days:30,pdf_url:"#",notes:"24h consulting block for migration off legacy CRM.",created_at:"2026-05-24",line_items:[{description:"Consulting (May, 24h \xD7 \u20AC180)",quantity:24,unit_price:"180,00",tax_rate:"19,00",total:"4.320,00"}],activity:[{ts:"24.05.2026 11:02",who:"demo-contact-redacted.company-x.example",verb:"Issued",note:""},{ts:"24.05.2026 11:04",who:"demo-contact-redacted.company-x.example",verb:"Sent to",note:"demo-contact-redacted.company-x.example"}]},{id:"inv-0040",invoice_number:"2026-0040",client_id:"cl-003",client_name:"BoutiqueX OG",issue_date:"\u2014",due_date:"\u2014",delivery_date:"\u2014",net_total:"1.680,00",tax_total:"319,20",gross_total:"1.999,20",status:"DRAFT",statusLabel:"Draft",payment_terms_days:30,pdf_url:"",notes:"Migration milestone 2 of 3.",created_at:"2026-05-22",line_items:[{description:"Migration package \u2014 phase 2",quantity:1,unit_price:"1.680,00",tax_rate:"19,00",total:"1.680,00"}],activity:[{ts:"22.05.2026 16:11",who:"demo-contact-redacted.company-x.example",verb:"Created draft",note:""}]},{id:"inv-0039",invoice_number:"2026-0039",client_id:"cl-005",client_name:"Novadex GmbH",issue_date:"12.05.2026",due_date:"11.06.2026",delivery_date:"12.05.2026",net_total:"2.480,00",tax_total:"471,20",gross_total:"2.951,20",status:"PAID",statusLabel:"Paid",payment_terms_days:30,pdf_url:"#",notes:"",created_at:"2026-05-12",line_items:[{description:"Assessment engagement \u2014 sprint 3",quantity:1,unit_price:"2.480,00",tax_rate:"19,00",total:"2.480,00"}],activity:[{ts:"12.05.2026 09:00",who:"demo-contact-redacted.company-x.example",verb:"Issued",note:""},{ts:"12.05.2026 09:01",who:"demo-contact-redacted.company-x.example",verb:"Sent to",note:"demo-contact-redacted.company-x.example"},{ts:"14.05.2026 11:24",who:"demo-contact-redacted.company-x.example",verb:"Marked",note:"PAID"}]},{id:"inv-0038",invoice_number:"2026-0038",client_id:"cl-004",client_name:"KoruFM Ltd",issue_date:"08.05.2026",due_date:"07.06.2026",delivery_date:"08.05.2026",net_total:"2.190,00",tax_total:"416,10",gross_total:"2.606,10",status:"PAID",statusLabel:"Paid",payment_terms_days:30,pdf_url:"#",notes:"Q2 \u2014 white-label podcast pipeline retainer.",created_at:"2026-05-08",line_items:[{description:"Retainer Q2 \u2014 podcast pipeline",quantity:1,unit_price:"2.190,00",tax_rate:"19,00",total:"2.190,00"}],activity:[{ts:"08.05.2026 12:00",who:"demo-contact-redacted.company-x.example",verb:"Issued",note:""},{ts:"08.05.2026 12:01",who:"demo-contact-redacted.company-x.example",verb:"Sent to",note:"demo-contact-redacted.company-x.example"},{ts:"10.05.2026 09:48",who:"demo-contact-redacted.company-x.example",verb:"Marked",note:"PAID"}]},{id:"inv-0037",invoice_number:"2026-0037",client_id:"cl-007",client_name:"Norddeutsche Bank",issue_date:"02.05.2026",due_date:"01.06.2026",delivery_date:"02.05.2026",net_total:"310,00",tax_total:"58,90",gross_total:"368,90",status:"CANCELLED",statusLabel:"Cancelled",payment_terms_days:30,pdf_url:"#",notes:"Voided after duplicate detected.",created_at:"2026-05-02",line_items:[{description:"Onboarding workshop",quantity:1,unit_price:"310,00",tax_rate:"19,00",total:"310,00"}],activity:[{ts:"02.05.2026 10:00",who:"demo-contact-redacted.company-x.example",verb:"Issued",note:""},{ts:"03.05.2026 14:10",who:"demo-contact-redacted.company-x.example",verb:"Cancelled",note:"duplicate of 2026-0036"}]}],s=[{id:"ex-512",date:"26.05.2026",vendor:"Google Cloud",category:"Hosting",net:"154,72",vat:"19",gross:"184,12",receipt:"#",notes:"GCP \u2014 eu-west \xB7 May portion"},{id:"ex-511",date:"22.05.2026",vendor:"Resend",category:"Email",net:"16,80",vat:"19",gross:"20,00",receipt:"#",notes:"Transactional email \u2014 May"},{id:"ex-510",date:"20.05.2026",vendor:"Stripe",category:"Payments fees",net:"12,40",vat:"0",gross:"12,40",receipt:"#",notes:"Card fees \u2014 week 21"},{id:"ex-509",date:"18.05.2026",vendor:"OpenRouter",category:"LLM",net:"34,20",vat:"19",gross:"40,70",receipt:"#",notes:"Inference \u2014 May 1-15"},{id:"ex-508",date:"14.05.2026",vendor:"Linear",category:"Tools",net:"8,00",vat:"19",gross:"9,52",receipt:"#",notes:"Linear Standard \u2014 1 seat"},{id:"ex-507",date:"10.05.2026",vendor:"Notion",category:"Tools",net:"12,00",vat:"19",gross:"14,28",receipt:"#",notes:"Notion Plus"},{id:"ex-506",date:"04.05.2026",vendor:"DB Reisezentrum",category:"Travel",net:"76,40",vat:"7",gross:"81,75",receipt:"#",notes:"Berlin \u2194 M\xFCnchen, customer mtg"},{id:"ex-505",date:"02.05.2026",vendor:"WeWork",category:"Office",net:"290,00",vat:"19",gross:"345,10",receipt:"#",notes:"Hot desk \u2014 May"}],r=[{id:"sub-1",customer:"demo-contact-redacted.company-x.example",tier:"Business",mrr:"99,00",started:"01.03.2026",renews:"01.06.2026",status:"ok",statusLabel:"active"},{id:"sub-2",customer:"demo-contact-redacted.company-x.example",tier:"Pro",mrr:"29,00",started:"12.04.2026",renews:"12.06.2026",status:"ok",statusLabel:"active"},{id:"sub-3",customer:"demo-contact-redacted.company-x.example",tier:"Pro",mrr:"29,00",started:"22.04.2026",renews:"22.06.2026",status:"warn",statusLabel:"past_due"},{id:"sub-4",customer:"demo-contact-redacted.company-x.example",tier:"Pics",mrr:"19,00",started:"02.05.2026",renews:"02.06.2026",status:"ok",statusLabel:"active"},{id:"sub-5",customer:"demo-contact-redacted.company-x.example",tier:"Quest",mrr:"9,00",started:"14.05.2026",renews:"14.06.2026",status:"ok",statusLabel:"trialing"},{id:"sub-6",customer:"demo-contact-redacted.company-x.example",tier:"Pro",mrr:"0,00",started:"08.03.2026",renews:"\u2014",status:"fail",statusLabel:"canceled"}],o=[{id:"tu-12",date:"12.04.2026",pack:"500 credits",amount:"5,00",method:"Stripe \xB7 card \xB7\xB7\xB7\xB7 4242"},{id:"tu-11",date:"08.03.2026",pack:"2.500 credits",amount:"25,00",method:"Stripe \xB7 card \xB7\xB7\xB7\xB7 4242"},{id:"tu-10",date:"01.02.2026",pack:"1.000 credits",amount:"10,00",method:"Stripe \xB7 card \xB7\xB7\xB7\xB7 4242"},{id:"tu-09",date:"11.01.2026",pack:"500 credits",amount:"5,00",method:"Stripe \xB7 card \xB7\xB7\xB7\xB7 4242"}],d=[{month:"January",revenue:"4.200,00",expenses:"148,12",profit:"4.051,88"},{month:"February",revenue:"3.900,00",expenses:"162,40",profit:"3.737,60"},{month:"March",revenue:"4.350,00",expenses:"184,12",profit:"4.165,88"},{month:"April",revenue:"4.290,00",expenses:"216,52",profit:"4.073,48"},{month:"May",revenue:"4.320,00",expenses:"707,87",profit:"3.612,13"},{month:"June",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"},{month:"July",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"},{month:"August",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"},{month:"September",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"},{month:"October",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"},{month:"November",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"},{month:"Dezember",revenue:"\u2014",expenses:"\u2014",profit:"\u2014"}];a.finDashboard={id:"finDashboard",label:"Finances dashboard",workspaceLabel:"Finances",workspaceIcon:"account_balance",description:"Receivables + ledger preview. The first thing the admin sees at /billing. de-DE \xB7 \u20AC.",defaultView:"dashboard",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"New invoice",kind:"primary",icon:"add"},secondaryActions:[{label:"New expense",icon:"note_add"},{label:"Settings",icon:"tune"}],heroKpis:[{label:"Outstanding",value:"\u20AC 12.480,00",delta:"+\u20AC 2.150",trend:"down"},{label:"Paid this month",value:"\u20AC  4.320,00",delta:"+\u20AC 1.110",trend:"up"},{label:"YTD revenue",value:"\u20AC 21.060,00",delta:"+\u20AC 4.320",trend:"up"},{label:"YTD expenses",value:"\u20AC  1.419,03",delta:"+\u20AC  707",trend:"down"},{label:"Open invoices",value:"3",delta:"+1",trend:"flat"},{label:"E\xDCR profit YTD",value:"\u20AC 19.640,97",delta:"+\u20AC 3.612",trend:"up"}],mockItems:[{id:"card-outstanding",title:"Outstanding \xB7 3 ISSUED",subtitle:"ACME \xB7 BoutiqueX \xB7 AaaS pro-rated",status:"warn",kpi:"\u20AC 12.480,00",sub:"sum invoiced \xB7 awaiting payment",linkOpens:"finances.invoices"},{id:"card-paid-month",title:"Paid \xB7 this month",subtitle:"2 invoices \xB7 AaaS + KoruFM",status:"ok",kpi:"\u20AC 4.320,00",sub:"2026-05 PAID",linkOpens:"finances.invoices"},{id:"card-ytd",title:"Revenue \xB7 YTD",subtitle:"18 invoices \xB7 2026",status:"ok",kpi:"\u20AC 21.060,00",sub:"incl. issued + paid",linkOpens:"finances.reports"},{id:"card-expenses",title:"Expenses \xB7 YTD",subtitle:"38 entries \xB7 hosting + LLM lead",status:"ok",kpi:"\u20AC 1.419,03",sub:"gross \xB7 all categories",linkOpens:"finances.expenses"},{id:"card-credits",title:"Credit balance",subtitle:"24.840 credits remaining",status:"ok",kpi:"\u20AC 248,40",sub:"1 credit = \u20AC0,01",linkOpens:"finances.credits"},{id:"card-bridge",title:"Admin-bridge",subtitle:"PR #1540 \xB7 cookie set",status:"ok",kpi:"OK",sub:"mutate enabled \xB7 admin uid",linkOpens:"finances.settings"}]},a.finInvoices={id:"finInvoices",label:"Invoices",workspaceLabel:"Finances",workspaceIcon:"receipt_long",description:"All invoices \xB7 DRAFT \xB7 ISSUED \xB7 PAID \xB7 CANCELLED. Select a row \u2192 invoice detail.",defaultView:"table",defaultDetail:"split",agentTreatment:"provenance",primaryAction:{label:"New invoice",kind:"primary",icon:"add"},secondaryActions:[{label:"Mark selected paid",icon:"task_alt"},{label:"Send selected",icon:"mail"},{label:"Export CSV",icon:"download"}],heroKpis:[{label:"All",value:"24",delta:"+2",trend:"up"},{label:"Draft",value:"3",delta:"+1",trend:"flat"},{label:"Issued",value:"5",delta:"+1",trend:"flat"},{label:"Paid",value:"15",delta:"+2",trend:"up"},{label:"Cancelled",value:"1",delta:"",trend:"flat"}],schema:[{key:"invoice_number",label:"#",mono:!0},{key:"client_name",label:"Client",wide:!0},{key:"issue_date",label:"Issued",mono:!0},{key:"due_date",label:"Due",mono:!0},{key:"gross_total",label:"Gross \u20AC",mono:!0,right:!0},{key:"status",label:"Status",kind:"status"}],statusFilters:[{id:"all",label:"All",count:24},{id:"DRAFT",label:"Draft",count:3},{id:"ISSUED",label:"Issued",count:5},{id:"PAID",label:"Paid",count:15},{id:"CANCELLED",label:"Cancelled",count:1}],mockItems:l.map(e=>({...e,title:`#${e.invoice_number} \xB7 ${e.client_name}`,subtitle:e.notes||e.line_items[0]&&e.line_items[0].description||"\u2014",preview:e.line_items.map(n=>`${n.description}   ${n.quantity} \xD7 \u20AC ${n.unit_price}   = \u20AC ${n.total}`).join(`
`),provenance:["billing-svc","admin-bridge"],status:{DRAFT:"idle",ISSUED:"running",PAID:"ok",CANCELLED:"fail"}[e.status]||"idle"})),rawInvoices:l,moreCount:18},a.finInvoiceDetail={id:"finInvoiceDetail",label:"Invoice detail",workspaceLabel:"Finances",workspaceIcon:"receipt_long",description:"Preserved as a sub-page for URL-parity with /billing/invoices/{id}. In Canvas the detail panel of an item on the Invoices list IS the detail screen.",defaultView:"placeholder",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"Open Invoices list",kind:"secondary",icon:"list"},secondaryActions:[],heroKpis:[],schema:[],mockItems:[],placeholderHint:"Select an invoice in Invoices \u2192 the right-pane / drawer detail IS this screen."},a.finInvoiceNew={id:"finInvoiceNew",label:"New invoice",workspaceLabel:"Finances",workspaceIcon:"post_add",description:"Compose, then commit through the 3-step backend flow: POST /invoices \u2192 N\xD7POST /line-items \u2192 POST /issue.",defaultView:"financeForm",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"Save, issue & send",kind:"red",icon:"rocket_launch"},secondaryActions:[{label:"Save & issue",icon:"mark_email_read"},{label:"Save as draft",icon:"save"},{label:"Cancel",icon:"close"}],heroKpis:[{label:"Next #",value:"2026-0043",trend:"flat"},{label:"VAT default",value:"19,00 %",trend:"flat"},{label:"Payment terms",value:"30 d",trend:"flat"}],schema:[],formSections:[{id:"client",label:"Client",fields:[{key:"client_id",label:"Client",kind:"client-picker",required:!0,value:"cl-001"},{key:"new_client",label:"",kind:"button",value:"+ New client"}]},{id:"dates",label:"Dates",fields:[{key:"issue_date",label:"Issue date",kind:"date",required:!0,value:"27.05.2026"},{key:"due_date",label:"Due date",kind:"date",required:!0,value:"26.06.2026"},{key:"delivery_date",label:"Delivery date",kind:"date",value:"31.05.2026"}]},{id:"items",label:"Line items",kind:"line-items",items:[{description:"Pro subscription \u2014 June 2026",quantity:1,unit_price:"290,00",tax_rate:"19,00",total:"290,00"}]},{id:"tax",label:"Tax + payment",fields:[{key:"tax_rate",label:"VAT rate",kind:"percent",value:"19,00"},{key:"payment_terms",label:"Payment terms",kind:"number",value:"30",suffix:"days"}]},{id:"totals",label:"Totals (preview)",kind:"totals",net:"290,00",vat:"55,10",gross:"345,10"},{id:"notes",label:"Notes",fields:[{key:"notes",label:"Notes (visible on PDF)",kind:"textarea",value:""}]}],flowSteps:[{id:"step1",label:"Create draft",hint:"POST /invoices/"},{id:"step2",label:"Add line items",hint:"N \xD7 POST /line-items"},{id:"step3",label:"Issue",hint:"POST /issue"},{id:"step4",label:"Email to client",hint:"sendInvoiceEmail()"}],mockItems:[]},a.finClients={id:"finClients",label:"Clients",workspaceLabel:"Finances",workspaceIcon:"group",description:"Customer records. AaaS is just another client \u2014 no special UI.",defaultView:"table",defaultDetail:"split",agentTreatment:"provenance",primaryAction:{label:"Add client",kind:"primary",icon:"person_add"},secondaryActions:[{label:"Bulk import",icon:"upload"},{label:"Export CSV",icon:"download"}],heroKpis:[{label:"Clients",value:"12",delta:"+1",trend:"up"},{label:"Active 30d",value:"7",delta:"+1",trend:"up"},{label:"Open receivables",value:"\u20AC 12.480,00",delta:"+\u20AC2.1k",trend:"down"},{label:"Lifetime",value:"\u20AC 54.260,00",delta:"+\u20AC4.3k",trend:"up"}],schema:[{key:"name",label:"Name",wide:!0},{key:"email",label:"Email"},{key:"address",label:"Address"},{key:"tax_id",label:"Tax-ID",mono:!0},{key:"invoices_count",label:"Invoices",mono:!0,right:!0},{key:"outstanding",label:"Open \u20AC ",mono:!0,right:!0}],mockItems:i.map(e=>({...e,title:e.name,subtitle:`${e.email} \xB7 ${e.address}`,status:e.outstanding==="0,00"?"ok":"warn",statusLabel:e.outstanding==="0,00"?"paid up":`\u20AC ${e.outstanding} open`,preview:`Tax-ID ${e.tax_id}
Client since ${e.created_at}
Lifetime  \u20AC ${e.lifetime}
Invoices  ${e.invoices_count}`,provenance:["billing-svc"]})),rawClients:i,moreCount:4},a.finClientDetail={id:"finClientDetail",label:"Client detail",workspaceLabel:"Finances",workspaceIcon:"group",description:"Preserved as a sub-page for URL-parity with /billing/clients/{id}. In Canvas the detail panel of an item on the Clients list IS the detail screen.",defaultView:"placeholder",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"Open Clients list",kind:"secondary",icon:"list"},secondaryActions:[],heroKpis:[],schema:[],mockItems:[],placeholderHint:"Select a client in Clients \u2192 the right-pane / drawer detail IS this screen."},a.finExpenses={id:"finExpenses",label:"Expenses",workspaceLabel:"Finances",workspaceIcon:"shopping_bag",description:"Outgoing cost ledger \u2014 manual entry today. Drives the E\xDCR report.",defaultView:"table",defaultDetail:"drawer",agentTreatment:"provenance",primaryAction:{label:"New expense",kind:"primary",icon:"add"},secondaryActions:[{label:"Filter month",icon:"filter_list"},{label:"Export CSV",icon:"download"}],heroKpis:[{label:"May netto",value:"\u20AC 604,52",delta:"+\u20AC 88",trend:"down"},{label:"May gross",value:"\u20AC 707,87",delta:"+\u20AC 104",trend:"down"},{label:"YTD gross",value:"\u20AC 1.419,03",delta:"",trend:"flat"},{label:"Entries",value:"8",delta:"+2",trend:"up"},{label:"Top category",value:"Office",delta:"",trend:"flat"}],schema:[{key:"date",label:"Date",mono:!0},{key:"vendor",label:"Vendor",wide:!0},{key:"category",label:"Category"},{key:"net",label:"Netto \u20AC",mono:!0,right:!0},{key:"vat",label:"VAT %",mono:!0,right:!0},{key:"gross",label:"Gross \u20AC",mono:!0,right:!0}],mockItems:s.map(e=>({...e,title:`${e.vendor} \xB7 ${e.category}`,subtitle:e.notes,status:"ok",statusLabel:"recorded",preview:`Date     ${e.date}
Vendor   ${e.vendor}
Cat.     ${e.category}
Netto    \u20AC ${e.net}
VAT      ${e.vat} %
Gross    \u20AC ${e.gross}
Receipt  ${e.receipt}`,provenance:["billing-svc"]})),rawExpenses:s,moreCount:30},a.finCredits={id:"finCredits",label:"Credits",workspaceLabel:"Finances",workspaceIcon:"token",description:"AaaS-internal credit-pack balance. Separate from invoices \u2014 top-ups go through the public Stripe pricing flow.",defaultView:"financeCredits",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"Top up credits",kind:"primary",icon:"add"},secondaryActions:[{label:"Open public /pricing",icon:"open_in_new"}],heroKpis:[{label:"Balance \u20AC",value:"\u20AC 248,40",delta:"",trend:"flat"},{label:"Credits",value:"24.840",delta:"+500",trend:"up"},{label:"Spent 30d",value:"12.840",delta:"+2.1k",trend:"down"},{label:"Top-ups YTD",value:"4",delta:"+1",trend:"up"}],schema:[],balance:{eur:"248,40",credits:"24.840",rate:"1 credit = \u20AC 0,01"},topups:o,mockItems:[]},a.finSubs={id:"finSubs",label:"Subscriptions",workspaceLabel:"Finances",workspaceIcon:"subscriptions",description:"Admin view of Pro / Business tiers. Read-only \u2014 cancellation runs via the public customer portal.",defaultView:"table",defaultDetail:"drawer",agentTreatment:"provenance",primaryAction:{label:"Open Stripe portal \u2197",kind:"secondary",icon:"open_in_new"},secondaryActions:[{label:"Export CSV",icon:"download"}],heroKpis:[{label:"MRR",value:"\u20AC 185,00",delta:"+\u20AC 29",trend:"up"},{label:"Active subs",value:"4",delta:"+2",trend:"up"},{label:"Trialing",value:"1",delta:"+1",trend:"up"},{label:"Past-due",value:"1",delta:"+1",trend:"down"},{label:"Churned this mo.",value:"1",delta:"\u22121",trend:"up"}],schema:[{key:"customer",label:"Customer",wide:!0},{key:"tier",label:"Tier",mono:!0},{key:"mrr",label:"MRR \u20AC",mono:!0,right:!0},{key:"started",label:"Started",mono:!0},{key:"renews",label:"Renews",mono:!0},{key:"status",label:"Status",kind:"status"}],mockItems:r.map(e=>({...e,title:`${e.customer} \xB7 ${e.tier}`,subtitle:`MRR \u20AC ${e.mrr} \xB7 renews ${e.renews}`,preview:`Tier      ${e.tier}
MRR       \u20AC ${e.mrr}
Started   ${e.started}
Renews    ${e.renews}
Status    ${e.statusLabel}`,provenance:["stripe-webhook"]}))},a.finReports={id:"finReports",label:"E\xDCR \xB7 Einnahmen-\xDCberschuss-Rechnung",workspaceLabel:"Finances",workspaceIcon:"analytics",description:"Monatliche Ums\xE4tze, Ausgaben und Gewinn f\xFCr ein Gesch\xE4ftsjahr. Server-derived from invoices + expenses.",defaultView:"financeEur",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"Download CSV",kind:"secondary",icon:"download"},secondaryActions:[{label:"Previous year",icon:"chevron_left"},{label:"Next year",icon:"chevron_right"}],heroKpis:[{label:"Year",value:"2026",trend:"flat"},{label:"Revenue YTD",value:"\u20AC 21.060,00",delta:"+\u20AC 4.320",trend:"up"},{label:"Expenses YTD",value:"\u20AC  1.419,03",delta:"+\u20AC  707",trend:"down"},{label:"Profit YTD",value:"\u20AC 19.640,97",delta:"+\u20AC 3.612",trend:"up"}],schema:[],year:2026,rows:d,totals:{revenue:"21.060,00",expenses:"1.419,03",profit:"19.640,97"},mockItems:[]},a.finSettings={id:"finSettings",label:"Business profile",workspaceLabel:"Finances",workspaceIcon:"tune",description:"Issuer data on every invoice PDF. Bank info, signatory, defaults. Owner / admin only.",defaultView:"financeForm",defaultDetail:"none",agentTreatment:"implicit",primaryAction:{label:"Save profile",kind:"primary",icon:"save"},secondaryActions:[{label:"Cancel",icon:"close"}],heroKpis:[{label:"Issuer",value:t.legal_name,trend:"flat"},{label:"Tax-ID",value:t.tax_id,trend:"flat"},{label:"Invoice prefix",value:t.invoice_prefix+t.next_number,trend:"flat"}],formTabs:["Business profile","Invoice defaults","Expense categories"],formSections:[{id:"identity",label:"Identity",fields:[{key:"legal_name",label:"Legal name *",kind:"text",value:t.legal_name,required:!0},{key:"trading_name",label:"Trading name",kind:"text",value:t.trading_name},{key:"tax_id",label:"Tax-ID (USt-IdNr) *",kind:"text",value:t.tax_id,mono:!0,required:!0,requiresConfirm:!0}]},{id:"address",label:"Address",fields:[{key:"address_line_1",label:"Address line 1 *",kind:"text",value:t.address_line_1,required:!0},{key:"address_line_2",label:"Address line 2",kind:"text",value:t.address_line_2},{key:"postcode",label:"Postcode *",kind:"text",value:t.postcode,required:!0,width:"120px"},{key:"city",label:"City *",kind:"text",value:t.city,required:!0},{key:"country",label:"Country *",kind:"select",value:t.country,options:["DE","AT","CH","NL","FR","GB"],required:!0}]},{id:"bank",label:"Bank",fields:[{key:"iban",label:"IBAN *",kind:"text",value:t.iban,mono:!0,required:!0,requiresConfirm:!0},{key:"bic",label:"BIC",kind:"text",value:t.bic,mono:!0},{key:"bank_name",label:"Bank name",kind:"text",value:t.bank_name}]},{id:"sig",label:"Signatory",fields:[{key:"signatory",label:"Signatory name",kind:"text",value:t.signatory},{key:"signature_img",label:"Signature image",kind:"upload",value:""}]},{id:"invdefaults",label:"Invoice defaults",fields:[{key:"invoice_prefix",label:"Invoice # prefix",kind:"text",value:t.invoice_prefix,mono:!0,width:"120px"},{key:"next_number",label:"Next counter",kind:"number",value:t.next_number,width:"120px"},{key:"payment_terms_days",label:"Default payment terms",kind:"number",value:t.payment_terms_days,suffix:"days",width:"160px"},{key:"default_tax_rate",label:"Default VAT rate",kind:"percent",value:"19,00",width:"160px"}]},{id:"cats",label:"Expense categories",kind:"chip-list",items:t.expense_categories}],mockItems:[]},window.FIN={ISSUER:t,CLIENTS:i,INVOICES:l,EXPENSES:s,SUBS:r,CREDIT_TOPUPS:o,EUR_ROWS:d}})();
