1import{l as fe,b as ye,r as u,s as w,u as _,j as e}from"./index-DmBrIuMr.js";import{a as ae,A as ne,F as be}from"./AdminSidebar-Dz2jlWrO.js";import{B as g}from"./button-BVgaPNYd.js";import{I as m}from"./input-DNrjBCpI.js";import{T as B}from"./textarea-C33N-Yy5.js";import{L as k}from"./label-O9YMgC1F.js";import{T as te,a as ie,b as P,c as I}from"./tabs-DfQXSliH.js";import{S as R,a as G,b as U,c as J,d as M}from"./select-DZPYCYQT.js";import{C as x,a as f,b as N,c as S}from"./card-TB3k6aIf.js";import{B as je}from"./badge-uRDqDh8a.js";import{packageLabel as ve}from"./service-packages-DdYPllew.js";import{L as we}from"./loader-circle-BgFsXzCb.js";import{A as _e}from"./arrow-left-CzyOJBz-.js";import{S as ke}from"./save-D6qEOoeQ.js";import{C as Ne}from"./copy-M8CVK2vH.js";import{E as Se}from"./external-link-BDzjTqCP.js";import{S as Ce}from"./send-BD_Wz44T.js";import{S as Ae}from"./sparkles-BrrgE7yr.js";import{T as K}from"./trash-2-BebMrzQA.js";import{P as H}from"./plus-CVNre3fH.js";import{T as Pe}from"./triangle-alert-DPxvu-XD.js";import"./collapsible-D0zW5Uld.js";import"./dialog-D3JEJsPU.js";import"./index-BtoCHN1J.js";import"./Combination-B-vZEg9O.js";import"./arcbound-logo-CirlOi0K.js";import"./client-milestones-DOu0tPRi.js";import"./search-CCKqCdzn.js";import"./lock-DBA2l9iU.js";import"./settings-D1IJfbPH.js";import"./sheet-CjBteLmu.js";import"./skeleton-D8LJgdIa.js";import"./brand-dna-sync-DHga0uj0.js";import"./proxy-C57zgbaQ.js";import"./MotionConfigContext-CXL-g263.js";import"./circle-check-DL1OwnOF.js";import"./linkedin-Dy_dDqrq.js";import"./globe-DPgUrQ5O.js";import"./chevron-down-BuzlTV0R.js";import"./chevron-right-Bm11si2L.js";import"./instagram-0TwqevRE.js";import"./newspaper-CBnzriss.js";import"./link-2-cf-z6TTm.js";import"./upload-CglqxmSA.js";import"./file-text-BUtOihor.js";import"./trending-up-DtnvdXPz.js";import"./megaphone-BEbC6UDr.js";import"./chart-column-ONkSD-Bx.js";import"./image-ChWzI2UK.js";import"./palette-DM6ZdyWE.js";import"./book-open-BzaisTnO.js";import"./message-square-IF7KFAME.js";import"./presentation-SrEC_6O4.js";import"./index-DMAls7C9.js";import"./index-Bf1vIFkb.js";import"./index-BdQq_4o_.js";import"./index-DhRot3XL.js";import"./chevron-up-1eUmRnJ4.js";import"./check-Bd6GKLth.js";const Ie=()=>Math.random().toString(36).slice(2,10),y=(l,p,h={})=>({id:Ie(),label:l,quantity:1,unitPrice:p,recurring:!1,interval:null,...h}),C=["Client provides timely feedback (within 5 business days) at each review checkpoint.","Client supplies access to relevant accounts, brand assets, and stakeholders required for delivery.","Scope is fixed to the deliverables enumerated above; changes are handled via written change orders."],A=["Paid media spend, ad budgets, and third-party software licenses.","Stock photography, custom illustration, or video production beyond what is explicitly listed.","Translation or localization into additional languages."],re={"arc-identity":{summary:"Arc Identity is a focused brand identity engagement: a strategic foundation, a visual identity system, and the core brand assets needed to show up consistently across every surface.",deliverables:["Brand strategy foundation (positioning, audience, voice, narrative)","Primary wordmark and supporting logo system","Color system, typography system, and core visual rules","Brand guidelines document (PDF + editable source)","Social profile assets (LinkedIn banner, avatar, headers)"],timeline:[{phase:"Discovery & Strategy",duration:"Weeks 1â2"},{phase:"Visual Identity Concepts",duration:"Weeks 3â4"},{phase:"Refinement & System Build",duration:"Weeks 5â6"},{phase:"Final Delivery & Guidelines",duration:"Week 7"}],lineItems:[y("Arc Identity engagement",12500,{description:"Strategy, visual identity, and brand asset system."})],assumptions:C,exclusions:A},"arc-launch":{summary:"Arc Launch combines brand identity with a marketing website, positioning the brand publicly with a strategic foundation, a visual identity system, and a fully designed and built site.",deliverables:["Brand strategy foundation","Visual identity system (logo, color, type, brand guidelines)","Website sitemap, page briefs, and content strategy","Designed and developed marketing website (up to ~8 pages)","On-page SEO setup and launch QA"],timeline:[{phase:"Discovery & Strategy",duration:"Weeks 1â2"},{phase:"Visual Identity",duration:"Weeks 3â5"},{phase:"Sitemap & Copy",duration:"Weeks 5â7"},{phase:"Website Design & Build",duration:"Weeks 7â11"},{phase:"Launch",duration:"Week 12"}],lineItems:[y("Arc Launch engagement",28500,{description:"Identity + marketing website, end-to-e
1nd."})],assumptions:C,exclusions:A},"arcbase-no-website":{summary:"ArcBase is an ongoing content + brand operating system. The non-website tier covers strategy, content creation, distribution, and continuous brand stewardship â built on top of an existing visual identity.",deliverables:["Monthly content strategy + calendar","Content production (LinkedIn, newsletter, social) per agreed cadence","Brand stewardship and asset upkeep","Monthly performance review and iteration"],timeline:[{phase:"Onboarding",duration:"Weeks 1â2"},{phase:"Steady-state operating cadence",duration:"Ongoing, monthly retainer"}],lineItems:[y("ArcBase monthly retainer",6500,{recurring:!0,interval:"monthly",description:"Ongoing content + brand operating system."})],assumptions:C,exclusions:A},"arcbase-with-website":{summary:"ArcBase with Website pairs the ongoing operating system with a designed marketing website kickoff, then an ongoing retainer for continuous content and brand growth.",deliverables:["Marketing website (design + build, ~8 pages)","Monthly content strategy + calendar","Content production per agreed cadence","Brand + website stewardship and iteration"],timeline:[{phase:"Website kickoff",duration:"Weeks 1â10"},{phase:"Steady-state operating cadence",duration:"Ongoing, monthly retainer"}],lineItems:[y("Website build (one-time)",18e3),y("ArcBase monthly retainer",7500,{recurring:!0,interval:"monthly"})],assumptions:C,exclusions:A},"arcbase-no-website-podcast":{summary:"ArcBase + Podcast layers a recurring podcast production engine on top of the core operating system.",deliverables:["Monthly content strategy + calendar","Content production per agreed cadence","Podcast production (recording, editing, publishing)","Brand stewardship and asset upkeep"],timeline:[{phase:"Onboarding",duration:"Weeks 1â2"},{phase:"Steady-state operating cadence",duration:"Ongoing, monthly retainer"}],lineItems:[y("ArcBase + Podcast monthly retainer",8500,{recurring:!0,interval:"monthly"})],assumptions:C,exclusions:A},"arcbase-with-website-podcast":{summary:"ArcBase + Website + Podcast is the full Arcbase operating system: site, content engine, and podcast production.",deliverables:["Marketing website (design + build, ~8 pages)","Monthly content strategy + calendar","Content production per agreed cadence","Podcast production (recording, editing, publishing)","Brand + website stewardship"],timeline:[{phase:"Website kickoff",duration:"Weeks 1â10"},{phase:"Steady-state operating cadence",duration:"Ongoing, monthly retainer"}],lineItems:[y("Website build (one-time)",18e3),y("ArcBase + Podcast monthly retainer",9500,{recurring:!0,interval:"monthly"})],assumptions:C,exclusions:A},"podcast-only":{summary:"Podcast Only is a focused production engagement covering recording, editing, and publishing on an agreed cadence.",deliverables:["Show strategy and format","Recording sessions per agreed cadence","Full post-production (edit, sound design, show notes)","Distribution to major podcast platforms"],timeline:[{phase:"Show development",duration:"Weeks 1â3"},{phase:"Steady-state production cadence",duration:"Ongoing, monthly retainer"}],lineItems:[y("Podcast monthly retainer",4500,{recurring:!0,interval:"monthly"})],assumptions:C,exclusions:A}};function V(l){return l&&re[l]?JSON.parse(JSON.stringify(re[l])):{summary:"",deliverables:[],timeline:[],lineItems:[y("Engagement fee",0)],assumptions:C,exclusions:A}}function Te(l){let p=0,h=0,E=0;for(const j of l){const T=(Number(j.quantity)||0)*(Number(j.unitPrice)||0);j.recurring&&j.interval==="monthly"?h+=T:j.recurring&&j.interval==="annual"?E+=T:p+=T}return{oneTime:p,monthly:h,annual:E}}const Le={clauses:[{id:"payment-terms",title:"Payment Terms",body:"One-time fees are invoiced upon execution of this agreement and are due net 7. Recurring retainers are billed in advance at the start of each billing period and are due net 7. Late payments accrue 1.5% per month."},{id:"term-termination",title:"Term & Termination",body:"This agreement begins on the date of signature and continues until the engagement is completed (project-based) or terminated by either party with 30 days' written notice (retainer-based). Earned fees through the termination date remain due."},{id:"ip",title:"Intellectual Property",body:"Upon full payment, all final deliverables created specifically for the Client under this agreement transfer to the Client. Arcbase retains rights to underlying tools, processes, frameworks, and the right to display the work in its portfolio."},{id:"confidentiality",title:"Confidentiality",body:"Each party agrees to keep confidential any non-public information shared during the engagement and to use it only to fulfill obligations under this agreement."}
1,{id:"warranties-liability",title:"Warranties & Limitation of Liability",body:"Services are provided in a professional, workmanlike manner. Except for breaches of confidentiality or IP obligations, each party's total liability is limited to the fees paid under this agreement in the three months preceding the claim."},{id:"governing-law",title:"Governing Law",body:"This agreement is governed by the laws of the State of Delaware. Disputes are resolved in the state or federal courts located in Delaware."},{id:"entire-agreement",title:"Entire Agreement",body:"This document and the Statement of Work above constitute the entire agreement between the parties and supersede any prior agreements or representations on the subject matter."}]};function We(){const l=new Uint8Array(24);return crypto.getRandomValues(l),Array.from(l,p=>p.toString(16).padStart(2,"0")).join("")}function Oe(){const l=Math.floor(1e5+Math.random()*9e5);return String(l)}const Be=[{value:"arc-identity",label:"Arc Identity"},{value:"arc-launch",label:"Arc Launch"},{value:"arcbase-no-website",label:"ArcBase (no website)"},{value:"arcbase-with-website",label:"ArcBase + Website"},{value:"arcbase-no-website-podcast",label:"ArcBase + Podcast"},{value:"arcbase-with-website-podcast",label:"ArcBase + Website + Podcast"},{value:"podcast-only",label:"Podcast Only"}],Me={signer_name:"",signer_email:"",signer_company:"",signer_title:"",signer_address:"",signer_phone:"",application_id:null,prospect_id:null};function Vs(){const{id:l}=fe(),p=ye(),h=!l||l==="new",[E,j]=u.useState(!h),[T,D]=u.useState(!1),[t,Q]=u.useState(null),[o,b]=u.useState(Me),[z,X]=u.useState(""),[$,Y]=u.useState("Statement of Work & Master Services Agreement"),[i,d]=u.useState(V(null)),[L,O]=u.useState(Le.clauses),[Z,le]=u.useState([]),[ee,oe]=u.useState([]),W=u.useMemo(()=>Te(i.lineItems),[i.lineItems]);u.useEffect(()=>{(async()=>{var n,r;const[{data:s},{data:a}]=await Promise.all([w.from("arcbase_applications").select("id, full_name, email, company, linkedin_url").order("created_at",{ascending:!1}).limit(100),w.from("sales_prospects").select("id, name, linkedin_url, website_url").order("created_at",{ascending:!1}).limit(100)]);if(le(s||[]),oe(a||[]),!h&&l){const{data:v,error:q}=await w.from("sales_contracts").select("*").eq("id",l).maybeSingle();if(q||!v){_.error("Contract not found"),p("/admin/sales/contracts");return}const c=v;Q(c),b({signer_name:c.signer_name||"",signer_email:c.signer_email||"",signer_company:c.signer_company||"",signer_title:c.signer_title||"",signer_address:c.signer_address||"",signer_phone:c.signer_phone||"",application_id:c.application_id,prospect_id:c.prospect_id}),X(c.service_package_key||""),Y(c.title||"Statement of Work & Master Services Agreement"),c.sow_data&&Object.keys(c.sow_data).length?d(c.sow_data):c.service_package_key&&d(V(c.service_package_key)),(r=(n=c.msa_data)==null?void 0:n.clauses)!=null&&r.length&&O(c.msa_data.clauses),j(!1)}})()},[l,h,p]);function ce(s){X(s),d(V(s))}function de(s){const a=Z.find(n=>n.id===s);
1a&&b({...o,application_id:s,prospect_id:null,signer_name:a.full_name||"",signer_email:a.email||"",signer_company:a.company||""})}function me(s){const a=ee.find(n=>n.id===s);a&&b({...o,prospect_id:s,application_id:null,signer_name:a.name||""})}function F(s,a){d({...i,lineItems:i.lineItems.map((n,r)=>r===s?{...n,...a}:n)})}function ue(){d({...i,lineItems:[...i.lineItems,{id:Math.random().toString(36).slice(2,10),label:"New line item",quantity:1,unitPrice:0,recurring:!1,interval:null}]})}function pe(s){d({...i,lineItems:i.lineItems.filter((a,n)=>n!==s)})}async function se(s={}){if(!o.signer_name||!o.signer_email)return _.error("Signer name and email are required"),null;D(!0);const a={...o,service_package_key:z||null,title:$,sow_data:i,msa_data:{clauses:L},totals:W,...s};let n=null;if(h){const{data:r,error:v}=await w.from("sales_contracts").insert(a).select("id").single();v?_.error(v.message):n=r.id}else if(l){const{error:r}=await w.from("sales_contracts").update(a).eq("id",l);r?_.error(r.message):n=l}return D(!1),n}async function he(){const s=await se();s&&(_.success("Saved"),h&&p(`/admin/sales/contracts/${s}`))}async function ge(){const s=await se();if(s){D(!0);try{const a=(t==null?void 0:t.share_token)||We(),n=(t==null?void 0:t.share_pin)||Oe(),{data:r,error:v}=await w.from("sales_contracts").update({share_token:a,share_pin:n,status:(t==null?void 0:t.status)==="draft"||!t?"sent":t.status,sent_at:(t==null?void 0:t.sent_at)||new Date().toISOString()}).eq("id",s).select("*").single();if(v)throw v;Q(r),await w.from("sales_contract_events").insert({contract_id:s,event_type:"sent",actor_kind:"admin"}),w.functions.invoke("contracts-hubspot-sync",{body:{contract_id:s}}).then(({error:q})=>{q&&console.warn("HubSpot sync deferred:",q.message)}),_.success("Share link ready")}catch(a){_.error(a.message||"Failed to generate link")}finally{D(!1)}}}function xe(){if(!(t!=null&&t.share_token))return;const s=`${window.location.origin}/sign/${t.share_token}`;navigator.clipboard.writeText(`${s} 2PIN: ${t.share_pin}`),_.success("Link + PIN copied")}return E?e.jsx(ae,{children:e.jsxs("div",{className:"flex min-h-screen w-full bg-background",children:[e.jsx(ne,{activeTab:"arclaunch",onTabChange:()=>{}}),e.jsx("main",{className:"flex-1 flex items-center justify-center",children:e.jsx(we,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})}):e.jsx(ae,{children:e.jsxs("div",{className:"flex min-h-screen w-full bg-background",children:[e.jsx(ne,{activeTab:"arclaunch",onTabChange:()=>{}}),e.jsx("main",{className:"flex-1 p-6 overflow-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(g,{variant:"ghost",size:"sm",onClick:()=>p("/admin/sales/contracts"),children:[e.jsx(_e,{className:"h-4 w-4 mr-1"})," Back"]}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-semibold font-display flex items-center gap-2",children:[e.jsx(be,{className:"h-5 w-5"})," ",h?"New contract":$]}),t&&e.jsxs("p",{className:"text-xs text-muted-foreground font-body",children:["Status: ",e.jsx(je,{variant:"secondary",children:t.status})]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:he,disabled:T,children:[e.jsx(ke,{className:"h-3.5 w-3.5 mr-1"})," Save"]}),t!=null&&t.share_token?e.jsxs(e.Fragment,{children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:xe,children:[e.jsx(Ne,{className:"h-3.5 w-3.5 mr-1"})," Copy link + PIN"]}),e.jsx(g,{variant:"outline",size:"sm",asChild:!0,children:e.jsxs("a",{href:`/sign/${t.share_token}`,target:"_blank",rel:"noreferrer",children:[e.jsx(Se,{className:"h-3.5 w-3.5 mr-1"})," Open"]})})]}):e.jsxs(g,{size:"sm",onClick:ge,disabled:T,children:[e.jsx(Ce,{className:"h-3.5 w-3.5 mr-1"})," Generate signing link"]})]})]}),(t==null?void 0:t.share_token)&&e.jsx(x,{className:"mb-4 bg-emerald-50/50 border-emerald-200",children:e.jsx(f,{className:"pt-4 pb-4 text-sm font-body",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[e.jsx("span",{className:"font-medium",children:"Private signing link:"}),e.jsxs("code",{className:"text-xs bg-background px-2 py-0.5 rounded",children:[window.location.origin,"/sign/",t.share_token]}),e.jsx("span",{className:"font-medium",children:"PIN:"}),e.jsx("code",{className:"text-xs bg-background px-2 py-0.5 rounded",children:t.share_pin})]})})}),e.jsxs(te,{defaultValue:"signer",children:[e.jsxs(ie,{children:[e.jsx(P,{value:"signer",children:"1. Signer"}),e.jsx(P,{value:"package",children:"2. Package"}),e.jsx(P,{value:"sow",children:"3. SOW"}),e.jsx(P,{value:"msa",children:"4. MSA"})]}),e.jsx(I,{value:"signer",className:"mt-4",children:e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Who is signing?"})}),e.jsxs(f,{className:"space-y-4",children:[e.jsxs(te,{defaultValue:"manual",children:[e.jsxs(ie,{children:[e.jsx(P,{value:"application",children:"From application"}),e.jsx(P,{value:"prospect",children:"From prospect"}),e.jsx(P,{value:"manual",children:"Manual"})]}),e.jsx(I,{value:"application",className:"mt-3",children:e.jsxs(R,{value:o.application_id||"",onValueChange:de,children:[e.jsx(G,{children:e.jsx(U,{placeholder:"Pick an applicant"})}),e.jsx(J,{children:Z.map(s=>e.jsxs(M,{value:s.id,children:[s.full_name," â ",s.email]},s.id))})]})}),e.jsx(I,{value:"prospect",className:"mt-3",children:e.jsxs(R,{value:o.prospect_id||"",onValueChange:me,children:[e.jsx(G,{children:e.jsx(U,{placeholder:"Pick a sales prospect"})}),e.jsx(J,{children:ee.map(s=>e.jsx(M,{value:s.id,children:s.name},s.id))})]})}),e.jsx(I,{value:"manual",className:"mt-3 text-xs text-muted-foreground font-body",children:"Just fill in the fields below."})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 pt-2",children:[e.jsxs("div",{children:[e.jsx(k,{children:"Full name *"}),e.jsx(m,{value:o.signer_name,onChange:s=>b({...o,signer_name:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Email *"}),e.jsx(m,{type:"email",value:o.signer_email,onChange:s=>b({...o,signer_email:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Company"}),e.jsx(m,{value:o.signer_company,onChange:s=>b({...o,signer_company:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Title"}),e.jsx(m,{value:o.signer_title,onChange:s=>b({...o,signer_title:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Billing address"}),e.jsx(m,{value:o.signer_address,onChange:s=>b({...o,signer_address:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Phone"}),e.jsx(m,{value:o.signer_phone,onChange:s=>b({...o,signer_phone:s.target.value})})]})]})]})]})}),e.jsx(I,{value:"package",className:"mt-4",children:e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Pick a package preset"})}),e.jsxs(f,{children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Be.map(s=>e.jsxs("button",{type:"button",onClick:()=>
2ce(s.value),className:`text-left border rounded-md p-3 hover:border-foreground transition ${z===s.value?"border-foreground bg-muted/40":"border-border"}`,children:[e.jsx("div",{className:"font-medium text-sm",children:s.label}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:V(s.value).summary})]},s.value))}),z&&e.jsxs("p",{className:"text-xs text-muted-foreground font-body mt-3 flex items-center gap-1",children:[e.jsx(Ae,{className:"h-3 w-3"})," Selected: ",ve(z),". SOW pre-filled â edit on the next tab."]})]})]})}),e.jsxs(I,{value:"sow",className:"mt-4 space-y-4",children:[e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Title"})}),e.jsx(f,{children:e.jsx(m,{value:$,onChange:s=>Y(s.target.value)})})]}),e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Summary"})}),e.jsx(f,{children:e.jsx(B,{rows:4,value:i.summary,onChange:s=>d({...i,summary:s.target.value})})})]}),e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Deliverables"})}),e.jsx(f,{children:e.jsx(B,{rows:6,value:i.deliverables.join(` 3`),onChange:s=>d({...i,deliverables:s.target.value.split(` 4`).filter(a=>a.length>0)}),placeholder:"One per line"})})]}),e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Timeline"})}),e.jsxs(f,{className:"space-y-2",children:[i.timeline.map((s,a)=>e.jsxs("div",{className:"grid grid-cols-12 gap-2 items-center",children:[e.jsx(m,{className:"col-span-5",value:s.phase,onChange:n=>{const r=[...i.timeline];r[a]={...s,phase:n.target.value},d({...i,timeline:r})}}),e.jsx(m,{className:"col-span-6",value:s.duration,onChange:n=>{const r=[...i.timeline];r[a]={...s,duration:n.target.value},d({...i,timeline:r})}}),e.jsx(g,{variant:"ghost",size:"icon",className:"col-span-1",onClick:()=>d({...i,timeline:i.timeline.filter((n,r)=>r!==a)}),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]},a)),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>d({...i,timeline:[...i.timeline,{phase:"New phase",duration:""}]}),children:[e.jsx(H,{className:"h-3.5 w-3.5 mr-1"})," Add phase"]})]})]}),e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Investment (line items)"})}),e.jsxs(f,{className:"space-y-2",children:[i.lineItems.map((s,a)=>e.jsxs("div",{className:"grid grid-cols-12 gap-2 items-center",children:[e.jsx(m,{className:"col-span-5",value:s.label,onChange:n=>F(a,{label:n.target.value}),placeholder:"Label"}),e.jsx(m,{type:"number",className:"col-span-2",value:s.quantity,onChange:n=>F(a,{quantity:Number(n.target.value)})}),e.jsx(m,{type:"number",className:"col-span-2",value:s.unitPrice,onChange:n=>F(a,{unitPrice:Number(n.target.value)}),placeholder:"Price"}),e.jsxs(R,{value:s.recurring?s.interval||"monthly":"one-time",onValueChange:n=>F(a,{recurring:n!=="one-time",interval:n==="one-time"?null:n}),children:[e.jsx(G,{className:"col-span-2",children:e.jsx(U,{})}),e.jsxs(J,{children:[e.jsx(M,{value:"one-time",children:"One-time"}),e.jsx(M,{value:"monthly",children:"Monthly"}),e.jsx(M,{value:"annual",children:"Annual"})]})]}),e.jsx(g,{variant:"ghost",size:"icon",className:"col-span-1",onClick:()=>pe(a),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]},s.id)),e.jsxs(g,{variant:"outline",size:"sm",onClick:ue,children:[e.jsx(H,{className:"h-3.5 w-3.5 mr-1"})," Add line item"]}),e.jsxs("div",{className:"border-t pt-3 mt-3 text-sm font-body",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"One-time total:"}),e.jsxs("span",{className:"font-medium",children:["$",W.oneTime.toLocaleString()]})]}),W.monthly>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Monthly recurring:"}),e.jsxs("span",{className:"font-medium",children:["$",W.monthly.toLocaleString()," / mo"]})]}),W.annual>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Annual recurring:"}),e.jsxs("span",{className:"font-medium",children:["$",W.annual.toLocaleString()," / yr"]})]})]})]})]}),e.jsxs(x,{children:[e.jsx(N,{children:e.jsx(S,{className:"text-base",children:"Assumptions & Exclusions"})}),e.jsxs(f,{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(k,{children:"Assumptions"}),e.jsx(B,{rows:5,value:i.assumptions.join(` 5`),onChange:s=>d({...i,assumptions:s.target.value.split(` 6`).filter(a=>a.length>0)})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Exclusions"}),e.jsx(B,{rows:5,value:i.exclusions.join(` 7`),onChange:s=>d({...i,exclusions:s.target.value.split(` 8`).filter(a=>a.length>0)})})]})]})]})]}),e.jsxs(I,{value:"msa",className:"mt-4 space-y-3",children:[e.jsx(x,{children:e.jsxs(f,{className:"pt-4 text-sm text-muted-foreground font-body flex items-start gap-2",children:[e.jsx(Pe,{className:"h-4 w-4 mt-0.5 shrink-0"}),"Default Master Services Agreement clauses. Edit per contract if needed."]})}),L.map((s,a)=>e.jsx(x,{children:e.jsxs(f,{className:"pt-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{value:s.title,onChange:n=>{const r=[...L];r[a]={...s,title:n.target.value},O(r)},className:"font-medium"}),e.jsx(g,{variant:"ghost",size:"icon",onClick:()=>O(L.filter((n,r)=>r!==a)),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]}),e.jsx(B,{rows:4,value:s.body,onChange:n=>{const r=[...L];r[a]={...s,body:n.target.value},O(r)}})]})},s.id)),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>O([...L,{id:Math.random().toString(36).slice(2,10),title:"New clause",body:""}]),children:[e.jsx(H,{className:"h-3.5 w-3.5 mr-1"})," Add clause"]})]})]})]})})]})})}export{Vs 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.