"use strict";exports.id=455,exports.ids=[455],exports.modules={66617:(a,b,c)=>{c.d(b,{X:()=>d});function d(a,b){return a&&"string"==typeof a?a.replace(/{{\s*([^}]+?)\s*}}/g,(a,c)=>{let d=String(c).split("."),e=b;for(let a of d){if(null==e)return"";e=e[a]}return null==e?"":String(e)}):a}},80455:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{STAGE_KIND:()=>k,executeStage:()=>j});var e=c(60105),f=c(66617),g=c(81774),h=a([e]);function i(a){return Array.isArray(a)&&0!==a.length?a.map((a,b)=>`${b+1}. **${a.name||"Unnamed"}** — ${a.percentage??"?"}%`).join("\n"):"_None provided._"}async function j({case:a,stage:b}){let c=b.config||{},d=a.intake_payload||{},h=a.context||{},j=(0,f.X)(c.title_template,{intake:d,...h})||`Case package — ${a.title}`,k=Array.isArray(c.include_stages)&&c.include_stages.length>0?c.include_stages:Object.keys(h),l=[];for(let b of(l.push(`# ${j}`),l.push(""),l.push(`**Case:** ${a.title}  `),l.push(`**Case ID:** ${a.id}  `),l.push(`**Definition:** ${a.definition_slug}  `),l.push(`**Generated:** ${new Date().toISOString()}`),l.push(""),l.push("## Applicant intake"),l.push(""),l.push(function(a){if(!a)return"_No intake payload recorded._";let b=[];return a.applicant_full_name&&b.push(`- **Applicant:** ${a.applicant_full_name}`),a.passport_number&&b.push(`- **Passport (redacted):** ${(0,g.$)(a.passport_number)}`),a.country_of_residence&&b.push(`- **Country of residence:** ${a.country_of_residence}`),a.email&&b.push(`- **Email:** ${a.email}`),a.proposed_company_name&&b.push(`- **Proposed entity:** ${a.proposed_company_name}`),a.business_activity&&b.push(`- **Business activity:** ${a.business_activity}`),a.share_capital_usd&&b.push(`- **Share capital (USD):** ${a.share_capital_usd}`),a.source_of_funds&&b.push(`
**Source of funds**

${a.source_of_funds}`),a.shareholders&&b.push(`
**Shareholders**

${i(a.shareholders)}`),b.join("\n")}(d)),k))if("intake"!==b&&h[b]){var m;let a=b.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase());l.push((m=h[b],null==m?"":`

## ${a}

\`\`\`json
${JSON.stringify(m,null,2)}
\`\`\``))}let n=l.join("\n"),o=(0,e.Dg)({title:j,kind:"markdown",content:n,project_id:a.project_id}),p=[];if(o?.artifact_id&&p.push(o.artifact_id),c.attach_moa_draft){let b=(0,e.Dg)({title:`MOA draft — ${d?.proposed_company_name||a.title}`,kind:"markdown",content:function(a){let b=a?.proposed_company_name||"the Company",c=Array.isArray(a?.shareholders)?a.shareholders:[];return[`# Memorandum of Association — Draft`,"",`**Company:** ${b}`,"**Jurisdiction:** Abu Dhabi Global Market (ADGM)",`**Generated:** ${new Date().toISOString()}`,"\n## 1. Name\n",`The name of the Company is **${b}**.`,"\n## 2. Registered Office\n\nThe registered office of the Company shall be situated within the Abu Dhabi Global Market.\n\n## 3. Objects\n",`The objects for which the Company is established are: ${a?.business_activity||"general commercial activity"}.`,"\n## 4. Share Capital\n",`The authorised share capital of the Company is **USD ${a?.share_capital_usd||"TBD"}**.`,"\n## 5. Shareholders\n",i(c),"\n## 6. Liability\n\nThe liability of the members is limited.\n\n---\n\n_This document is an advisory draft generated by the Madarx OS process engine in demo mode. Not legal advice._"].join("\n")}(d),project_id:a.project_id});b?.artifact_id&&p.push(b.artifact_id)}return{kind:"pass",output:{package_title:j,artifact_ids:p,stages_included:k},artifact_ids:p}}e=(h.then?(await h)():h)[0];let k="package";d()}catch(a){d(a)}})}};