1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[30869],{3929:function(e,n,l){l.d(n,{default:function(){return o}});var s=l(57437),i=l(2265),r=l(62869),t=l(29558),a=l(94508);function o(e){let{formattedValue:n,className:l,maxDisplay:o}=e,[d,c]=(0,i.useState)(!1),u=d?n:n.slice(0,o),m=n.length-o;return(0,s.jsxs)("div",{className:(0,a.cn)("flex flex-wrap gap-2",l),children:[u.map(e=>(0,s.jsx)(t.Z,{children:(0,s.jsx)("span",{className:"truncate",children:e})},e)),n.length>o&&(d?(0,s.jsx)(r.z,{variant:"link",size:"sm",onClick:()=>c(!1),className:"mt-1 p-0 h-auto",children:"Hide"}):(0,s.jsxs)(r.z,{variant:"link",size:"sm",onClick:()=>c(!0),className:"mt-1 p-0 h-auto",children:["View ",m," more"]}))]})}},57288:function(e,n,l){l.d(n,{F3:function(){return d},Lb:function(){return m},Ms:function(){return u},bt:function(){return c}});var s=l(57437),i=l(30401),r=l(32489),t=l(64342);l(2265);var a=l(3929),o=l(94508);let d=e=>{var n,l,i,r;let{qualifier:t,lenderQualifier:a}=e;if(!t.config||!a)return"-";switch(t.config.type){case"boolean":return(0,s.jsx)(m,{value:null!==(n=a.qualifies)&&void 0!==n?n:null});case"array":return(0,s.jsx)(u,{value:null!==(l=a.value_option_ids)&&void 0!==l?l:[],config:t.config,className:"flex justify-end overflow-hidden",maxDisplay:5});case"number":return(0,s.jsx)(c,{minValue:null!==(i=a.min_value)&&void 0!==i?i:null,maxValue:null!==(r=a.max_value)&&void 0!==r?r:null,config:t.config});default:return(0,s.jsx)("div",{children:"-"})}},c=e=>{let{minValue:n,maxValue:l,config:i,className:r,showPrefix:a=!0}=e,d=!isNaN(Number(n))&&null!==n,c=!isNaN(Number(l))&&null!==l,u=(0,t.dI)({minValue:n,maxValue:l},i);return Array.isArray(u)?null:(0,s.jsx)("div",{className:(0,o.cn)("flex items-center space-x-2 text-xs justify-center",r||"text-foreground"),children:d&&c?(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{children:Array.isArray(u)?"":null==u?void 0:u.minValue}),(0,s.jsx)("div",{children:" - "}),(0,s.jsx)("div",{children:Array.isArray(u)?"":null==u?void 0:u.maxValue})]}):d&&!c?(0,s.jsx)("div",{className:"flex items-center space-x-2",children:(0,s.jsxs)("div",{children:[a&&"Min ",Array.isArray(u)?"":null==u?void 0:u.minValue]})}):c&&!d?(0,s.jsx)("div",{className:"flex items-center space-x-2",children:(0,s.jsxs)("div",{children:[a&&"Max ",Array.isArray(u)?"":null==u?void 0:u.maxValue]})}):null})};function u(e){let{value:n,config:l,className:i,maxDisplay:r=5}=e;if(!n||!l)return(0,s.jsx)("div",{children:"-"});let o=(0,t.dI)(n,l);return(0,s.jsx)(a.default,{formattedValue:o,className:i,maxDisplay:r})}let m=e=>{let{value:n}=e;return null==n?(0,s.jsx)("div",{children:"-"}):(0,s.jsx)("div",{className:"flex items-center justify-center",children:n?(0,s.jsx)(i.Z,{className:"size-5 text-green-500"}):(0,s.jsx)(r.Z,{className:"size-5 text-destructive"})})}},96080:function(e,n,l){var s=l(57437);l(2265);var i=l(73578),r=l(57288),t=l(64342),a=l(30401),o=l(32489),d=l(57054);let c=e=>{let{filterValue:n,qualifierValue:l,config:i}
1=e,o=l?(0,s.jsx)("div",{className:"inline-flex items-center px-5 py-1 rounded-full text-xs font-medium overflow-hidden text-ellipsis whitespace-nowrap bg-red-100 text-red-800",children:(0,s.jsx)(r.bt,{minValue:l.min_value,maxValue:l.max_value,config:i,className:"text-red-800"})}):(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)("span",{className:"inline-flex items-center px-5 py-1 rounded-full text-xs font-medium overflow-hidden text-ellipsis whitespace-nowrap bg-green-100 text-green-800",children:[(0,s.jsx)(a.Z,{className:"size-4 mr-2"}),(0,t.Fo)(n,i)]})});return l?(0,s.jsxs)(d.Popover,{children:[(0,s.jsx)(d.PopoverTrigger,{asChild:!0,children:(0,s.jsx)("div",{className:"cursor-pointer",children:o})}),(0,s.jsx)(d.PopoverContent,{className:"w-auto max-w-xs",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.bt,{minValue:l.min_value,maxValue:l.max_value,config:i}),l.notes&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:l.notes})]})})]}):o},u=e=>{let{value:n}=e,l=(0,s.jsx)("div",{className:"flex items-center justify-center",children:n?(0,s.jsx)(o.Z,{className:"size-5 text-red-800"}):(0,s.jsx)(a.Z,{className:"size-5 text-green-500"})});return n?(0,s.jsxs)(d.Popover,{children:[(0,s.jsx)(d.PopoverTrigger,{asChild:!0,children:(0,s.jsx)("div",{className:"cursor-pointer",children:l})}),(0,s.jsx)(d.PopoverContent,{className:"w-auto max-w-xs",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.Lb,{value:n.qualifies}),n.notes&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:n.notes})]})})]}):l},m=e=>{var n,l,i;let{filterValue:t,qualifierValue:c,config:u}=e;if(!t||!u)return(0,s.jsx)("div",{children:"-"});let m=!c,x=null===(l=u.options)||void 0===l?void 0:null===(n=l.find(e=>e.id===t))||void 0===n?void 0:n.value,f=(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)("span",{className:"inline-flex items-center px-5 py-1 rounded-full text-xs font-medium ".concat(m?"bg-green-100 text-green-800":"bg-red-100 text-red-800"," overflow-hidden text-ellipsis whitespace-nowrap"),children:[m?(0,s.jsx)(a.Z,{className:"size-4 mr-2"}):(0,s.jsx)(o.Z,{className:"size-4 mr-2"}),x]})});return(null==c?void 0:null===(i=c.value_option_ids)||void 0===i?void 0:i.length)?(0,s.jsxs)(d.Popover,{children:[(0,s.jsx)(d.PopoverTrigger,{asChild:!0,children:(0,s.jsx)("div",{className:"cursor-pointer",children:f})}),(0,s.jsx)(d.PopoverContent,{className:"w-auto max-w-xs",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(r.Ms,{value:c.value_option_ids||[],config:u}),c.notes&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:c.notes})]})})]}):f};n.Z=e=>{let{qualifier:n,qualifierValue:l,filterValue:r,onClick:t,keyId:a,editable:o}=e;return(0,s.jsx)(i.pj,{align:"center",onClick:()=>null==t?void 0:t(),className:"".concat(o&&t?"cursor-pointer":""),children:(0,s.jsx)("div",{className:"flex flex-col",children:"number"===n.config.type?(0,s.jsx)(c,{filterValue:r,qualifierValue:l,config:n.config}):"array"===n.config.type?(0,s.jsx)(m,{filterValue:r,qualifierValue:l,config:n.config}):(0,s.jsx)(u,{value:l})})},n.id+a)}},92596:function(e,n,l){var s=l(57437);l(2265);var i=l(26110),r=l(62869),t=l(88685),a=l(47190);n.Z=e=>{let{isOpen:n,onClose:l,failedTimeRestriction:o}=e,d=(null==o?void 0:o.name)===t.HR.PromptUserSignup;return(0,s.jsx)(i.Vq,{open:n,onOpenChange:e=>{e||l()},children:(0,s.jsx)(i.cZ,{className:"max-h-screen overflow-y-auto",children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.fK,{children:[(0,s.jsx)(i.$N,{children:o.dialogTitle}),(0,s.jsx)(i.Be,{children:null==o?void 0:o.dialogMessage})]}),(0,s.jsx)(a.SignupForm,{hideImage:!0})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.fK,{children:[(0,s.jsx)(i.$N,{children:null==o?void 0:o.dialogTitle}),(0,s.jsx)(i.Be,{children:null==o?void 0:o.dialogMessage})]}),(0,s.jsx)(i.cN,{children:(0,s.jsx)(r.z,{variant:"outline",children:"Close"})})]})})})}},13765:function(e,n,l){l.d(n,{_D:function(){return x},i4:function(){return h},wW:function(){return v}});var s=l(57437),i=l(80886),r=l(74928),t=l(94508),a=l(64972),o=l(40875),d=l(2265);let c=(0,l(30166).default)(()=>Promise.all([l.e(49344),l.e(35629)]).then(l.bind(l,35629)).then(e=>e.Response),{loadableGenerated:{webpack:()=>[35629]},ssr:!1}),u=(0,d.createContext)(null),m=()=>{let e=(0,d.useContext)(u);if(!e)throw Error("Reasoning components must be used within Reasoning");return e},x=(0,d.memo)(e=>{let{className:n,isStreaming:l=!1,open:a,defaultOpen:o=!0,onOpenChange:c,duration:m,children:x,...f}=e,[v,h]=(0,i.T)({prop:a,defaultProp:o,onChange:c}),[g,j]=(0,i.T)({prop:m,defaultProp:0}),[p,N]=(0,d.useState)(!1),[b,w]=(0,d.useState)(null);return(0,d.useRef)(!1),(0,d.useEffect)(()=>{l?null===b&&w(Date.now()):null!==b&&(j(Math.ceil((Date.now()-b)/1e3)),w(null))},[l,b,j]),(0,d.useEffect)(()=>
1{if(o&&!l&&v&&!p){let e=setTimeout(()=>{h(!1),N(!0)},1e3);return()=>clearTimeout(e)}},[l,v,o,h,p]),(0,s.jsx)(u.Provider,{value:{isStreaming:l,isOpen:v,setIsOpen:h,duration:g},children:(0,s.jsx)(r.zF,{className:(0,t.cn)("not-prose mb-4",n),onOpenChange:e=>{h(e)},open:v,...f,children:x})})}),f=(e,n)=>e||0===n?(0,s.jsx)("p",{children:"Thinking..."}):void 0===n?(0,s.jsx)("p",{children:"Thought for a few seconds"}):(0,s.jsxs)("p",{children:["Thought for ",n," seconds"]}),v=(0,d.memo)(e=>{let{className:n,children:l,...i}=e,{isStreaming:d,isOpen:c,duration:u}=m();return(0,s.jsx)(r.wy,{className:(0,t.cn)("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",n),...i,children:null!=l?l:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.Z,{className:"size-4"}),f(d,u),(0,s.jsx)(o.Z,{className:(0,t.cn)("size-4 transition-transform",c?"rotate-180":"rotate-0")})]})})}),h=(0,d.memo)(e=>{let{className:n,children:l,...i}=e;return(0,s.jsx)(r.Fw,{className:(0,t.cn)("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",n),...i,children:(0,s.jsx)(c,{className:"grid gap-2",children:l})})});x.displayName="Reasoning",v.displayName="ReasoningTrigger",h.displayName="ReasoningContent"},2347:function(e,n,l){l.d(n,{CopilotDisplay:function(){return t}});var s=l(57437);l(2265);var i=l(30401),r=l(66070);function t(e){let{content:n}=e;try{let e=JSON.parse(n),l=Object.entries(e).filter(e=>{let[n,l]=e;return"on"===l||"additional_query"===n&&""!==l}).map(e=>{let[n,l]=e;return"additional_query"===n?l:n}).join(", ");return(0,s.jsxs)(r.Zb,{className:"p-3 md:p-4 w-full flex justify-between items-center",children:[(0,s.jsx)("h5",{className:"text-muted-foreground text-xs truncate",children:l}),(0,s.jsx)(i.Z,{size:16,className:"text-green-500 w-4 h-4"})]})}catch(e){return null}}},94685:function(e,n,l){l.d(n,{Z:function(){return k}});var s=l(57437),i=l(2265),r=l(26320),t=l(6596),a=l(66070),o=e=>{let{result:n}=e;return(0,s.jsx)(a.Zb,{className:"w-full border-none bg-transparent",children:(0,s.jsx)(a.aY,{className:"p-0",children:(0,s.jsx)(t.Accordion,{type:"single",collapsible:!0,className:"w-full divide-y",children:n||null})})})},d=l(84951),c=l(69430),u=l(23027),m=l(87725),x=l(21454);function f(){var e,n,l,t,a,o,d,f,v,h;let[g]=(0,r.g9)(),[j,p]=(0,i.useState)(0),N=null==g?void 0:g.messages,b=!!(null==g?void 0:g.aeId),w=null==g?void 0:null===(e=g.tenant)||void 0===e?void 0:e.tenant_type,y=(0,i.useMemo)(()=>{let e=null==N?void 0:N.some(e=>"assistant"===e.role);if(!(null==g?void 0:g.preferredLenderIds)||!N)return[];let n=N.findLastIndex(e=>"user"===e.role);if(-1===n)return[];let l=N.slice(n+1).filter(e=>"tool"===e.role&&"searchSingleLenderTool"===e.name).map(e=>{var n;return null===(n=e.args)||void 0===n?void 0:n.lender_id}).filter(Boolean);return g.preferredLenderIds.map(e=>{var n;return null==g?void 0:null===(n=g.accountExecutives)||void 0===n?void 0:n.find(n=>{var l;return(null===(l=n.account_executive)||void 0===l?void 0:l.lender_id)===e&&n.is_primary})}).filter(n=>{var s;return e&&(null==n?void 0:null===(s=n.account_executive)||void 0===s?void 0:s.lender_id)&&l.includes(n.account_executive.lender_id)})},[null==g?void 0:g.preferredLenderIds,null==g?void 0:g.accountExecutives,N]);if((0,i.useEffect)(()=>{y.length>0&&p(function(e){if(0===e||1===e)return 0;let n=Array.from({length:e},(e,n)=>n>=0&&n<2?3:n>=2&&n<4||n>=4&&n<6?2:1),l=Math.random()*n.reduce((e,n)=>e+n,0),s=0;for(let e=0;e<n.length;e++)if(l<=(s+=n[e]))return e;return 0}(y.length))},[y.length]),0===y.length&&w!==u.wJ.Lender||w===u.wJ.Lender&&(!(null==g?void 0:g.accountExecutives)||0===g.accountExecutives.length))return null;let k=b?null==g?void 0:null===(l=g.accountExecutives)||void 0===l?void 0:null===(n=l.find(e=>{var n;return(null===(n=e.account_executive)||void 0===n?void 0:n.id)===(null==g?void 0:g.aeId)}))||void 0===n?void 0:n.account_executive:w===u.wJ.Lender?null==g?void 0:null===(a=g.accountExecutives)||void 0===a?void 0:null===(t=a.find(e=>e.is_primary))||void 0===t?void 0:t.account_executive:null===(o=y[j])||void 0===o?void 0:o.account_executive,C=null==g?void 0:null===(d=g.lenders)||void 0===d?void 0:d.find(e=>e.id===(null==k?void 0:k.lender_id));if(!k||!C)return null;let S=(0,s.jsx)(x.Z,{selectedAE:k,lender:C,size:"lg"});return(0,s.jsxs)("div",{className:"flex justify-end w-full overflow-hidden px-1",children:[w!==u.wJ.Lender&&(0,s.jsx)(c.y,{trigger:S,defaultToPricing:!0,presetLenderId:null!==(f=k.lender_id)&&void 0!==f?f:void 0},k.lender_id),w===u.wJ.Lender&&(0,s.jsx)(m.q,{trigger:S,defaultToPricing:!0,lenderId:null!==(h=null!==(v=k.lender_id)&&void 0!==v?v:null==C?void 0:C.id)&&void 0!==h?h:void 0},k.lender_id)]})}var v=l(37157),h=l(31810),g=l(62869),j=l(26110),p=l(76818),N=l(99376),b=l(19060),w=l(94508);function y(e){var n;let{userId:l,message:t,admin:a,isExample:o}=e,d=(0,N.useRouter)(),{submitUserFeedback:c}=(0,r.ol)(),u=null==t?void 0:null===(n=t.userFeedback)||void 0===n?void 0:n.find(e=>e.userId===l),[m,x]=(0,i.useState)(null),[f,y]=(0,i.useState)(""),[k,C]=(0,i.useState)(""),[S,Z]=(0,i.useState)(!1),[z,_]=(0,i.useState)(!1),[A,R]=(0,i.useState)(!1),I=()=>{Z(!0);try{c({messageId:t.id,name:"user-feedback",value:"positive"===m?1:-1,comment:""!==k?k:void 0},z&&a).then(()=>{a&&d.refresh()})}catch(e){x(null)}Z(!1),y(k),C(""),R(!1)};(0,i.useEffect)(()=>
1{if(u){var e;x(1===u.value?"positive":"negative"),y(null!==(e=u.comment)&&void 0!==e?e:"")}},[u]);let T="positive"===m,L="negative"===m;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{onClick:()=>{m&&a&&(C(null!=f?f:""),R(!0))},className:(0,w.cn)("p-2 flex flex-row items-center rounded-lg transition-all duration-200 max-w-fit",m&&a?"bg-card shadow-sm border border-accent/80 hover:shadow-md":"hover:bg-accent/30 rounded-lg"),children:[(0,s.jsxs)("div",{className:"flex gap-2 pr-2 pl-1",children:[(0,s.jsx)(g.z,{size:"icon",variant:L?"default":"ghost",className:(0,w.cn)("transition-all duration-200 hover:bg-red-100/50 dark:hover:bg-red-950/30 size-8",L?"bg-red-100/80 dark:bg-red-950/50 hover:bg-red-100/90 dark:hover:bg-red-950/60":""),onClick:()=>{x("negative"),C(null!=f?f:""),R(!0)},children:(0,s.jsx)(v.Z,{strokeWidth:L?3:2,className:"size-3 ".concat(L?"text-destructive":"text-red-500/70 dark:text-red-400/70")})}),(0,s.jsx)(g.z,{size:"icon",variant:T?"default":"ghost",className:(0,w.cn)("transition-all duration-200 hover:bg-green-100/50 dark:hover:bg-green-950/30 size-8",T?"bg-green-100/80 dark:bg-green-950/50 hover:bg-green-100/90 dark:hover:bg-green-950/60":""),onClick:()=>{x("positive"),C(null!=f?f:""),R(!0)},children:(0,s.jsx)(h.Z,{strokeWidth:T?3:2,className:"size-3 ".concat(T?"text-green-500":"text-green-500/70 dark:text-green-400/70")})})]}),(0,s.jsx)("div",{className:(0,w.cn)("p-2 transition-colors max-w-48 truncate",f?"text-foreground/90":"text-muted-foreground/80","text-sm"),children:f||"Helpful?"})]}),(0,s.jsx)(j.Vq,{open:!!A,onOpenChange:()=>{S||I()},children:(0,s.jsxs)(j.cZ,{children:[(0,s.jsxs)(j.fK,{children:[(0,s.jsx)(j.$N,{children:u?"Edit your feedback":"Do you want to add a comment?"}),(0,s.jsx)(j.Be,{children:(0,s.jsx)(p.g,{className:"mt-4 mb-2",rows:10,value:null!=k?k:"",onChange:e=>C(e.target.value)})}),a&&(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(b.X,{id:"saveResponseAsExample",checked:z||o,onCheckedChange:e=>_(e),disabled:o}),(0,s.jsx)("label",{htmlFor:"saveResponseAsExample",className:"ml-2 text-md ".concat(o?"text-muted-foreground opacity-50":"text-muted-foreground"),children:o?"Already saved as example":"Save Response as Example"})]})]}),(0,s.jsxs)(j.cN,{children:[(0,s.jsx)(g.z,{disabled:S,type:"submit",onClick:()=>I(),variant:"secondary",children:"No, thank you"}),(0,s.jsx)(g.z,{disabled:S,type:"submit",onClick:()=>I(),children:S?"Saving...":u?"Save":"Submit"})]})]})})]})}var k=e=>{var n,l;let{userId:i,message:a,admin:c,isExample:u,isLastMessage:m}=e,[x]=(0,r.g9)(),v=x.messages.filter(e=>"searchSingleLenderTool"===e.name&&a.id===e.id),h=x.messages.filter(e=>"searchSingleProgramTool"===e.name&&a.id===e.id);return(0,s.jsxs)("div",{children:[(0,s.jsxs)(t.Accordion,{type:"multiple",defaultValue:c||!m?["Answer"]:["Answer","Lender Options","Related","Filters","Lenders","Programs","section"],children:[(0,s.jsx)("div",{children:a.component},"component"),"assistant"===a.role&&a.secondaryComponent&&(0,s.jsx)(d.Section,{title:v.length>0?"Lenders":h.length>0?"Programs":"",subtitle:v.length>0?" (".concat(v.length,")"):h.length>0?" (".concat(h.length,")"):"",children:(0,s.jsx)("div",{className:"w-full max-w-full flex flex-wrap",children:(0,s.jsx)(o,{result:a.secondaryComponent})})})]}),"assistant"===a.role&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4 md:mb-8 mt-2 flex-wrap",children:[(0,s.jsx)(y,{userId:i,message:a,admin:c,isExample:u}),m&&!!(null===(n=x.user)||void 0===n?void 0:n.email)&&(0,s.jsx)("div",{className:"flex-shrink-0 px-1 flex items-center",children:(0,s.jsx)(f,{})})]})})]},null!==(l=a.id)&&void 0!==l?l:a.role)}},19060:function(e,n,l){l.d(n,{X:function(){return o}});var s=l(57437),i=l(2265),r=l(9270),t=l(30401),a=l(94508);let o=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)(r.fC,{ref:n,className:(0,a.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",l),...i,children:(0,s.jsx)(r.z$,{className:(0,a.cn)("flex items-center justify-center text-current"),children:(0,s.jsx)(t.Z,{className:"h-4 w-4"})})})});o.displayName=r.fC.displayName},73578:function(e,n,l){l.d(n,{RM:function(){return o},SC:function(){return d},iA:function(){return t},pj:function(){return u},ss:function(){return c},xD:function(){return a}});var s=l(57437),i=l(2265),r=l(94508);
1let t=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:n,className:(0,r.cn)("w-full caption-bottom text-sm",l),...i})})});t.displayName="Table";let a=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("thead",{ref:n,className:(0,r.cn)("[&_tr]:border-b",l),...i})});a.displayName="TableHeader";let o=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("tbody",{ref:n,className:(0,r.cn)("[&_tr:last-child]:border-0",l),...i})});o.displayName="TableBody",i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("tfoot",{ref:n,className:(0,r.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",l),...i})}).displayName="TableFooter";let d=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("tr",{ref:n,className:(0,r.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",l),...i})});d.displayName="TableRow";let c=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("th",{ref:n,className:(0,r.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",l),...i})});c.displayName="TableHead";let u=i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("td",{ref:n,className:(0,r.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",l),...i})});u.displayName="TableCell",i.forwardRef((e,n)=>{let{className:l,...i}=e;return(0,s.jsx)("caption",{ref:n,className:(0,r.cn)("mt-4 text-sm text-muted-foreground",l),...i})}).displayName="TableCaption"},54419:function(e,n,l){l.d(n,{default:function(){return g}});var s=l(57437),i=l(2265),r=l(6596),t=l(26110),a=l(73578),o=l(64342),d=l(96080);function c(e){let{isOpen:n,onClose:l,lenderItems:i,loanFilters:r}=e,c=Object.keys(r).map(e=>r[e].qualifier).filter(e=>null!=e).sort((e,n)=>e.name.localeCompare(n.name));return(0,s.jsx)(t.Vq,{open:n,onOpenChange:l,children:(0,s.jsxs)(t.cZ,{className:"max-w-5xl max-h-[80vh] overflow-hidden flex flex-col",children:[(0,s.jsx)(t.fK,{children:(0,s.jsx)(t.$N,{children:"Just Missed"})}),(0,s.jsx)("div",{className:"flex flex-col overflow-hidden h-full w-full",children:(0,s.jsxs)(a.iA,{children:[(0,s.jsx)(a.xD,{className:"sticky top-0 z-10 backdrop-blur bg-background/80",children:(0,s.jsxs)(a.SC,{children:[(0,s.jsx)(a.ss,{colSpan:2,className:"p-2 text-left font-semibold min-w-[100px]",children:"Lender"}),c.map(e=>{var n,l,i;return(0,s.jsx)(a.ss,{className:"p-2 text-center font-semibold min-w-[150px] whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex-grow flex items-center justify-center space-x-3",children:[(0,s.jsx)("div",{className:"text-muted-foreground",children:(null==e?void 0:e.config)&&(0,o.qG)(e.config.type)}),(0,s.jsxs)("div",{className:"font-medium text-sm",children:[null==e?void 0:e.name," ",(null==e?void 0:null===(n=e.config)||void 0===n?void 0:n.type)!=="number"||isNaN(+(null===(l=r[e.id])||void 0===l?void 0:l.value))?"":"(".concat((0,o.Fo)(+(null===(i=r[e.id])||void 0===i?void 0:i.value),e.config),")")]})]})},null==e?void 0:e.id)})]})}),(0,s.jsx)(a.RM,{children:i.map(e=>(0,s.jsxs)(a.SC,{children:[(0,s.jsx)(a.pj,{className:"font-medium py-0",colSpan:2,children:(0,s.jsx)("div",{className:"flex items-center space-x-2",children:e.lender.logo?(0,s.jsx)("img",{src:e.lender.logo,alt:"".concat(e.lender.name," logo"),className:"w-20 h-20 object-contain"}):(0,s.jsx)("div",{className:"w-8 h-8 bg-gray-100 flex items-center justify-center rounded",children:(0,s.jsx)("span",{className:"text-xs font-medium text-gray-600",children:e.lender.name.charAt(0)})})})}),c.map(n=>{var l,i,t,a;return(0,s.jsx)(d.Z,{keyId:"".concat(e.lender.id,"-").concat(n.id),qualifierValue:null!==(i=e.qualifierValues.find(e=>e.qualifier_id===n.id))&&void 0!==i?i:null,filterValue:null!==(a=null===(l=r[null!==(t=n.id)&&void 0!==t?t:""])||void 0===l?void 0:l.value)&&void 0!==a?a:null,qualifier:n},"".concat(e.lender.id,"-").concat(n.id))})]},e.lender.id))})]})})]})})}var u=l(29643),m=l(62869);function x(e){let{lendersWithQualifiers:n=[],loanFilters:l}=e,[r,t]=i.useState(!1),a=Object.keys(l).filter(e=>"lenderIds"!==e&&!!l[e]).length;return(0,s.jsxs)(i.Fragment,{children:[(0,s.jsxs)("div",{className:"relative w-full px-6 cursor-pointer hover:bg-accent/40 transition-colors duration-300",onClick:()=>t(!0),children:[(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(m.z,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:"View All"})}),(0,s.jsx)(u.k,{lenders:n.map(e=>({...e.lender,badge:(0,s.jsx)("div",{className:"text-xs px-2 py-1 rounded-full ".concat(e.qualifierValues.length===a?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"),children:"".concat(a-e.qualifierValues.length,"/").concat(a)})}))})]}),(0,s.jsx)(c,{isOpen:r,onClose:()=>t(!1),lenderItems:n,loanFilters:l})]})}var f=l(8637),v=l(29558),h=l(94508);function g(e){let{lenderItems:n,loanFilters:l}
1=e,[t,a]=i.useState(!1);return(0,s.jsxs)(r.AccordionItem,{value:"excluded-lenders",className:(0,h.cn)("px-4 transition-colors duration-200",t||"hover:bg-accent/40"),children:[(0,s.jsx)(r.AccordionTrigger,{onClick:()=>a(!t),children:(0,s.jsxs)("div",{className:"flex items-center w-full justify-between",children:[(0,s.jsx)("div",{className:"font-medium w-full text-left",children:"Just Missed"}),(0,s.jsx)("div",{className:"mr-2",children:(0,s.jsxs)(v.Z,{children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 mr-2"}),(0,s.jsx)("span",{className:"text-sm font-bold",children:n.length})]})})]})}),(0,s.jsx)(r.AccordionContent,{children:(0,s.jsx)(x,{lendersWithQualifiers:n,loanFilters:l})})]})}},41664:function(e,n,l){l.d(n,{default:function(){return u}});var s=l(57437),i=l(2265),r=l(6596),t=l(28688),a=l(94508),o=l(26320),d=l(92596),c=l(18910);function u(e){var n,l,u,m;let{content:x,lender:f,searchSources:v,query:h,eligibleQualifiers:g}=e,[j,p]=i.useState(!1),[N]=(0,o.g9)(),b=(null==N?void 0:null===(n=N.tenant)||void 0===n?void 0:n.tenant_type)==="lender",w=null==N?void 0:N.readOnly,[y,k]=i.useState(!1);return(0,s.jsxs)(r.AccordionItem,{value:"lender-".concat(null==f?void 0:f.id,"-").concat(null==x?void 0:x.slice(0,50)),className:(0,a.cn)("px-4 transition-all duration-300 animate-in fade-in-0",j||"hover:bg-accent/40"),children:[(0,s.jsx)(r.AccordionTrigger,{className:"flex-1 w-full",onClick:()=>p(!j),children:(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsx)("div",{className:"flex items-center gap-2 shrink-0",children:(null==f?void 0:f.logo)&&(0,s.jsx)("img",{src:f.logo,alt:"".concat(f.name," logo"),height:24,className:"h-8 object-contain max-w-40 max-h-8 dark:contrast-50 shrink"})}),(0,s.jsx)("span",{className:"mr-4",children:null==f?void 0:f.name})]})}),(0,s.jsxs)(r.AccordionContent,{className:"px-2",children:[(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(t.x,{isToolResult:!0,children:(0,s.jsx)(t.BotMessage,{content:x,enableCitations:!0})})}),(0,s.jsx)(c.Z,{lender:f,isAnonymous:!(null===(l=N.user)||void 0===l?void 0:l.email),searchSources:v,query:h,eligibleQualifiers:g,readOnly:w,isLenderTenant:b})]}),(0,s.jsx)(d.Z,{isOpen:y,onClose:()=>k(!1),failedTimeRestriction:null!==(m=null===(u=N.userMessageRestrictions)||void 0===u?void 0:u.timeRestrictions.find(e=>{var n;return e.userData&&!(null===(n=e.userData)||void 0===n?void 0:n.passes)}))&&void 0!==m?m:null})]})}},60665:function(e,n,l){l.d(n,{default:function(){return b}});var s=l(57437),i=l(2265),r=l(6596),t=l(73247),a=l(29558),o=l(29643),d=l(26110),c=l(35250),u=l(26320),m=l(88685),x=l(32062),f=l(54080),v=l(28184),h=l(93415),g=l(62869),j=l(92596);function p(e){var n,l,r,t,a,p,N,b,w,y,k,C,S;let{messageId:Z,pastUserMessages:z,loanFilters:_,allLenders:A}=e,[R,I]=(0,u.g9)(),[T,L]=(0,u.J7)(),[V,P]=i.useState(!1),{submitUserMessage:q}=(0,u.ol)(),[M,F]=i.useState(!1),[E,O]=i.useState(null),D=async e=>{F(!1);let n={..._,lenderIds:{value:e,selectedByUser:!0}};I(e=>({...e,filters:{...e.filters,loan_filters:n}}));let l="Revaluate my loan scenario with the updated available lenders";L(e=>[...e,{id:(0,h.Ox)(),role:"user",content:l,component:(0,s.jsx)(v.X,{message:l})}]);let i=await q({content:l,loanFilters:n});L(e=>[...e,i])},J=A.filter(e=>!!z.some(n=>{var l,s,i,r;return null===(r=n.filters)||void 0===r?void 0:null===(i=r.loan_filters)||void 0===i?void 0:null===(s=i.lenderIds)||void 0===s?void 0:null===(l=s.value)||void 0===l?void 0:l.includes(e.id)}
1)).map(e=>e.id),B=A.filter(e=>!J.includes(e.id)),W=B.map(e=>e.id),$=null!==(y=null===(t=R.preferredLenderIds)||void 0===t?void 0:null===(r=t.filter(e=>!J.includes(e)))||void 0===r?void 0:r.slice(0,null===(l=R.tenant)||void 0===l?void 0:null===(n=l.config)||void 0===n?void 0:n.max_lender_selections))&&void 0!==y?y:[];$.length<(null===(p=R.tenant)||void 0===p?void 0:null===(a=p.config)||void 0===a?void 0:a.max_lender_selections)&&($=$.concat(W.filter(e=>{var n;return!$.includes(e)&&!(null===(n=R.preferredLenderIds)||void 0===n?void 0:n.includes(e))}).slice(0,(null===(C=R.tenant)||void 0===C?void 0:null===(k=C.config)||void 0===k?void 0:k.max_lender_selections)-$.length)));let K=$.length+J.length===A.length,H=T.findIndex(e=>e.id===Z)===T.length-1;return(0,s.jsxs)(i.Fragment,{children:[(0,s.jsxs)("div",{className:"relative w-full px-2 pb-1",children:[(0,s.jsxs)("div",{className:"flex justify-end gap-2 py-1",children:[!!H&&(0,s.jsx)(g.z,{size:"sm",variant:"outline",onClick:()=>{(0,m.mh)(R.userMessageRestrictions)?D($):P(!0)},disabled:0===$.length,children:K?"Search Last ".concat(1===W.length?"Lender":W.length):"Search Next ".concat($.length)}),(0,s.jsx)(g.z,{variant:"ghost",size:"sm",onClick:()=>{(0,m.mh)(R.userMessageRestrictions)?F(!0):P(!0)},children:"View All"})]}),(0,s.jsx)("div",{className:"px-4 flex-1 w-full",children:(0,s.jsx)(o.k,{lenders:B,disableSelect:!H,onSelect:e=>{(0,m.mh)(R.userMessageRestrictions)?(O(e),F(!0)):P(!0)}})})]}),(0,s.jsx)(d.Vq,{open:M,onOpenChange:()=>{O(null),F(!1)},children:(0,s.jsxs)(d.cZ,{className:"max-w-7xl min-h-[80vh] max-h-[80vh] overflow-hidden flex flex-col",children:[(0,s.jsx)(d.fK,{children:(0,s.jsx)(d.$N,{children:(0,s.jsxs)("div",{className:"flex gap-1 items-center mb-2",children:[(0,s.jsx)(x.Z,{className:"w-5 h-5 mr-1"}),(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Search More Lenders"})]})})}),(0,s.jsx)(c.Z,{viewOnly:!H,saveLabel:"Resubmit Search",enforceChange:!1,inChat:!0,saveIcon:(0,s.jsx)(f.Z,{className:"w-4 h-4 ml-2"}),lenderOptions:B,onSave:D,initialSelectedLenderIds:E?[E]:[],tenantConfig:null===(N=R.tenant)||void 0===N?void 0:N.config})]})}),(0,s.jsx)(j.Z,{isOpen:V,onClose:()=>P(!1),failedTimeRestriction:null!==(S=null===(w=R.userMessageRestrictions)||void 0===w?void 0:null===(b=w.timeRestrictions)||void 0===b?void 0:b.find(e=>e.userData&&!e.userData.passes))&&void 0!==S?S:null})]})}var N=l(94508);function b(e){let{loanFilters:n,allLenders:l,pastUserMessages:o,messageId:d}=e,[c,m]=i.useState(!1),[x]=(0,u.g9)(),f=null==x?void 0:x.readOnly,v=l.filter(e=>!o.some(n=>{var l,s,i,r;return null===(r=n.filters)||void 0===r?void 0:null===(i=r.loan_filters)||void 0===i?void 0:null===(s=i.lenderIds)||void 0===s?void 0:null===(l=s.value)||void 0===l?void 0:l.includes(e.id)}
1));return!f&&(0,s.jsxs)(r.AccordionItem,{value:"non-preferred-lenders",className:(0,N.cn)("w-full px-4 transition-all duration-300 animate-in fade-in-0",c||"hover:bg-accent/40"),children:[(0,s.jsx)(r.AccordionTrigger,{className:"flex-1 w-full",onClick:()=>m(!c),children:(0,s.jsxs)("div",{className:"flex items-center w-full justify-between",children:[(0,s.jsx)("div",{className:"font-medium w-full text-left",children:"Search More Lenders"}),v.length>0&&(0,s.jsx)("div",{className:"mr-2",children:(0,s.jsxs)(a.Z,{children:[(0,s.jsx)(t.Z,{className:"w-4 h-4 mr-2"}),(0,s.jsx)("span",{className:"text-sm font-bold",children:v.length})]})})]})}),(0,s.jsx)(r.AccordionContent,{children:v.length>0?(0,s.jsx)(p,{pastUserMessages:o,loanFilters:n,allLenders:l,messageId:d}):(0,s.jsx)("div",{className:"text-sm text-center h-20 flex items-center justify-center w-full",children:"All lenders have been searched."})})]})}},29643:function(e,n,l){l.d(n,{k:function(){return a}});var s=l(57437),i=l(2265),r=l(26902),t=l(66070);function a(e){let{lenders:n=[],onSelect:l,disableSelect:a=!1}=e,[o,d]=i.useState(),c=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!o)return;let e=setInterval(()=>{o.scrollNext()},3e3);return()=>clearInterval(e)},[o]),(0,s.jsxs)(r.lr,{ref:c,opts:{align:"start",loop:!0,watchResize:!0,slidesToScroll:1,dragFree:!0},setApi:d,children:[(0,s.jsx)(r.KI,{className:"p-3",children:n.map(e=>(0,s.jsx)(r.d$,{onClick:!a&&l?()=>l(e.id):void 0,className:"basis-1/2 sm:basis-1/2 md:basis-1/3 lg:basis-1/4 xl:basis-1/5 relative ".concat(!a&&l?"group":""," px-2"),children:(0,s.jsxs)("div",{className:"relative w-full h-full ".concat(a?"":"transition-transform duration-300 group-hover:scale-105"),children:[e.badge&&(0,s.jsx)("div",{className:"absolute top-2 right-2 z-10",children:e.badge}),(0,s.jsx)(t.Zb,{className:"w-full h-full overflow-hidden bg-background ".concat(a?"":"transition-all duration-300"," \n ").concat(!a&&l?"cursor-pointer":"","\n ").concat(e.badge?"py-2":"","\n ").concat(!a&&l?"group-hover:shadow-lg":""),children:e.logo?(0,s.jsx)("div",{className:"w-16 h-16 sm:w-20 sm:h-20 md:w-24 md:h-24 lg:w-28 lg:h-28 flex items-center justify-center mx-auto \n ".concat(!a&&l?"transition-transform duration-300":""),children:(0,s.jsx)("img",{src:e.logo,alt:"".concat(e.name," logo"),className:"w-full h-auto object-contain mx-auto rounded-sm dark:contrast-50"})}):(0,s.jsx)("div",{className:"w-16 h-16 sm:w-20 sm:h-20 md:w-24 md:h-24 lg:w-28 lg:h-28 bg-accent flex items-center justify-center\n ".concat(!a&&l?"transition-all duration-300":""),children:(0,s.jsx)("span",{className:"text-xs font-medium text-accent-foreground text-center px-2",children:e.name})})})]})},e.id))}),(0,s.jsx)(r.am,{onClick:e=>{e.stopPropagation(),null==o||o.scrollPrev()},className:"absolute -left-3 h-6 w-6 hover:bg-primary hover:text-white z-10"}),(0,s.jsx)(r.Pz,{onClick:e=>{e.stopPropagation(),null==o||o.scrollNext()},className:"absolute -right-3 h-6 w-6 hover:bg-primary hover:text-white z-10"})]})}},16814:function(e,n,l){l.r(n),l.d(n,{AnswerSection:function(){return d}});var s=l(57437),i=l(84951),r=l(26320),t=l(28688),a=l(2265),o=l(13765);function d(e){let{result:n,content:l,hasHeader:o=!0,reasoning:d,showReasoning:m=!1}=e,[x,f,v]=(0,r.el)(n),[h,g]=(0,a.useState)(""),j=l||h;return((0,a.useEffect)(()=>{x&&g(x)},[x]),0===j.length)?(0,s.jsx)("div",{children:m&&d?(0,s.jsx)(c,{result:d}):(0,s.jsx)(u,{})}):(0,s.jsx)("div",{children:(0,s.jsxs)(i.Section,{title:o?"Answer":void 0,children:[m&&d&&(0,s.jsx)(c,{result:d}),(0,s.jsx)(t.BotMessage,{content:j})]})})}function c(e){let{result:n}=e,[l,i,t]=(0,r.el)(n),[d,c]=(0,a.useState)("");return(0,a.useEffect)(()=>{"string"==typeof l&&c(l)},[l]),(0,s.jsxs)(o._D,{isStreaming:t,defaultOpen:!1,children:[(0,s.jsx)(o.wW,{}),(0,s.jsx)(o.i4,{children:d||(t?"Processing...":"No reasoning available for this model")})]})}let u=()=>{let e=["Reviewing question & scenario...","Searching lender guidelines...","Analyzing program details...","Comparing eligible options...","Preparing personalized response...","Almost there..."],[n,l]=(0,a.useState)(e[0]),[i,r]=(0,a.useState)(0);return(0,a.useEffect)(()=>{let n=setInterval(()=>{r(n=>Math.min(n+1,e.length-1))},5e3);return()=>clearInterval(n)},[]),(0,a.useEffect)(()=>
1{l(e[i])},[i]),(0,s.jsxs)("div",{className:"w-full flex flex-col items-start justify-center",children:[(0,s.jsx)("div",{className:"text-foreground/60 text-sm animate-pulse",children:n}),(0,s.jsxs)("div",{className:"relative mt-3 gap-x-2 flex items-center justify-center w-16 h-8 bg-primary/5 rounded-lg",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0s"}}),(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:" w-2 h-2 bg-gray-500 rounded-full animate-bounce",style:{animationDelay:"0.4s"}})]})]})}},57640:function(e,n,l){l.d(n,{ErrorCard:function(){return c}});var s=l(57437);l(2265);var i=l(62869),r=l(49322),t=l(35685),a=l(52636),o=l(26320),d=l(65613);let c=e=>{let{errorMessage:n}=e,[l,c]=(0,o.J7)(),[u,m]=(0,o.g9)(),{submit:x}=(0,o.ol)(),f=async()=>{c(l.slice(0,-1));let e=u.messages,n=[...e].reverse().find(e=>"user"===e.role),s=[];if(n){let l=e.findIndex(e=>e===n);s=e.slice(0,l+1)}let i=await x(void 0,!1,s);c(e=>[...e,i])},{title:v,message:h,icon:g}=n.toLowerCase().includes("rate limit")?{title:"Rate Limit Reached",message:"We're experiencing high demand. Please wait a moment before trying again.",icon:r.Z}:n.toLowerCase().includes("network")||n.toLowerCase().includes("fetch")?{title:"Connection Issue",message:"We're having trouble connecting. Please check your internet connection and try again.",icon:r.Z}:n.toLowerCase().includes("timeout")?{title:"Request Timeout",message:"The request took too long to complete. Please try again with a simpler query.",icon:r.Z}:n.toLowerCase().includes("not found")?{title:"Information Not Found",message:"We couldn't find the information you're looking for. Please refine your search and try again.",icon:t.Z}:{title:"Something went wrong",message:"We encountered an unexpected issue. Please try again or contact support if the problem persists.",icon:r.Z};return(0,s.jsxs)(d.bZ,{className:"border-red-200 bg-red-50 dark:border-red-900 dark:bg-red-950",children:[(0,s.jsx)(g,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,s.jsx)(d.Cd,{className:"text-red-800 dark:text-red-200",children:v}),(0,s.jsx)(d.X,{className:"text-red-700 dark:text-red-300",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{children:h}),(0,s.jsx)("form",{action:f,children:(0,s.jsxs)(i.z,{size:"sm",variant:"outline",type:"submit",className:"border-red-300 hover:bg-red-100 dark:border-red-800 dark:hover:bg-red-900",children:[(0,s.jsx)(a.Z,{size:14,className:"mr-2"}),"Try Again"]})})]})})]})}},84951:function(e,n,l){l.d(n,{Section:function(){return g}});var s=l(57437),i=l(94508),r=l(53113),t=l(32062),a=l(43044),o=l(4554),d=l(32096),c=l(41466),u=l(87604),m=l(96897),x=l(3577),f=l(73247);l(2265);var v=l(6512),h=l(6596);let g=e=>{let n,{children:l,className:g,size:j="md",title:p,separator:N=!1,subtitle:b}=e,w="mr-1.5 text-muted-foreground";switch(p){case"Images":n=(0,s.jsx)(r.Z,{size:16,className:w});break;case"Lenders":n=(0,s.jsx)(t.Z,{size:16,className:w});break;case"Programs":n=(0,s.jsx)(a.Z,{size:16,className:w});break;case"Videos":n=(0,s.jsx)(o.Z,{size:16,className:w});break;case"Sources":n=(0,s.jsx)(d.Z,{size:16,className:w});break;case"Answer":n=(0,s.jsx)(c.Z,{size:16,className:w});break;case"Related":n=(0,s.jsx)(u.Z,{size:16,className:w});break;case"Follow-up":n=(0,s.jsx)(m.Z,{size:16,className:w});break;case"Filters":n=(0,s.jsx)(x.Z,{size:16,className:w});break;default:n=(0,s.jsx)(f.Z,{size:16,className:w})}return(0,s.jsxs)(h.AccordionItem,{value:p||"section",children:[N&&(0,s.jsx)(v.Separator,{className:"my-2 bg-primary/10"}),p&&(0,s.jsx)(h.AccordionTrigger,{className:"pb-2",children:(0,s.jsxs)("h2",{className:"flex items-center leading-none py-2",children:[n,p,b]})}),(0,s.jsx)(h.AccordionContent,{children:(0,s.jsx)("section",{className:(0,i.cn)("".concat("sm"===j?"py-1":"lg"===j?"py-4 pb-2":"py-2"),"relative",g),children:l})})]})}},77290:function(e,n,l){l.d(n,{default:function(){return x}});var s=l(57437),i=l(2265),r=l(6596),t=l(8637),a=l(29558),o=l(94508),d=l(73578),c=l(64342),u=l(96080);function m(e){let{lender:n,programItems:l,loanFilters:i}=e,r=Object.keys(i).map(e=>
1i[e].qualifier).filter(e=>null!=e).sort((e,n)=>e.name.localeCompare(n.name)),t=l.sort((e,l)=>{let s=n.programs.find(n=>n.id===e.id),i=n.programs.find(e=>e.id===l.id);return s&&i?s.name.localeCompare(i.name):0});return(0,s.jsx)("div",{className:"max-w-full overflow-x-auto",children:(0,s.jsxs)(d.iA,{children:[(0,s.jsx)(d.xD,{className:"sticky top-0 z-10",children:(0,s.jsxs)(d.SC,{children:[(0,s.jsx)(d.ss,{colSpan:2,className:"p-2 text-left font-semibold min-w-[100px] text-xs",children:"Program"}),r.map(e=>{var n,l,r;return(0,s.jsx)(d.ss,{className:"p-2 text-center font-semibold min-w-[150px] whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex-grow flex items-center justify-center space-x-1.5",children:[(0,s.jsx)("div",{className:"text-muted-foreground",children:(null==e?void 0:e.config)&&(0,c.qG)(e.config.type)}),(0,s.jsxs)("div",{className:"text-xs",children:[null==e?void 0:e.name," ",(null==e?void 0:null===(n=e.config)||void 0===n?void 0:n.type)!=="number"||isNaN(+(null===(l=i[e.id])||void 0===l?void 0:l.value))?"":"(".concat((0,c.Fo)(+(null===(r=i[e.id])||void 0===r?void 0:r.value),e.config),")")]})]})},null==e?void 0:e.id)})]})}),(0,s.jsx)(d.RM,{children:t.map(e=>{let l=n.programs.find(n=>n.id===e.id);return l?(0,s.jsxs)(d.SC,{children:[(0,s.jsx)(d.pj,{className:"font-medium min-w-[225px]",colSpan:2,children:(0,s.jsx)("div",{className:"flex items-center space-x-2 text-sm",children:(0,s.jsx)("span",{children:l.name})})}),r.map(n=>{var r,t,a,o;return(0,s.jsx)(u.Z,{qualifier:n,qualifierValue:null!==(t=e.qualifierValues.find(e=>e.qualifier_id===n.id))&&void 0!==t?t:null,filterValue:null!==(o=null===(r=i[null!==(a=n.id)&&void 0!==a?a:""])||void 0===r?void 0:r.value)&&void 0!==o?o:null,keyId:"".concat(l.id,"-").concat(n.id)},"".concat(l.id,"-").concat(n.id))})]},l.id):null})})]})})}function x(e){let{lender:n,programItems:l,loanFilters:d}=e,[c,u]=(0,i.useState)(!1);return n?(0,s.jsxs)(r.AccordionItem,{value:"just-missed-programs",className:(0,o.cn)("px-4 transition-colors duration-200",c||"hover:bg-accent/40"),children:[(0,s.jsx)(r.AccordionTrigger,{onClick:()=>u(!c),children:(0,s.jsxs)("div",{className:"flex items-center w-full justify-between",children:[(0,s.jsxs)("div",{className:"font-medium w-full text-left",children:["Just Missed Programs for ",n.name]}),(0,s.jsx)("div",{className:"mr-2",children:(0,s.jsxs)(a.Z,{children:[(0,s.jsx)(t.Z,{className:"w-4 h-4 mr-2"}),(0,s.jsx)("span",{className:"text-sm font-bold",children:l.length})]})})]})}),(0,s.jsx)(r.AccordionContent,{children:(0,s.jsx)(m,{lender:n,programItems:l,loanFilters:d})})]}):null}},63305:function(e,n,l){l.d(n,{default:function(){return u}});var s=l(57437),i=l(2265),r=l(6596),t=l(28688),a=l(94508),o=l(26320),d=l(92596),c=l(18910);function u(e){var n,l,u;let{content:m,program:x,searchSources:f,query:v,eligibleQualifiers:h}=e,[g,j]=i.useState(!1),[p]=(0,o.g9)(),N=null==p?void 0:p.readOnly,[b,w]=i.useState(!1),y=p.lenders.find(e=>e.id===(null==x?void 0:x.lender_id));return y?(0,s.jsxs)(r.AccordionItem,{value:"program-".concat(null==x?void 0:x.id,"-").concat(null==m?void 0:m.slice(0,50)),className:(0,a.cn)("px-4 transition-all duration-300 animate-in fade-in-0",g||"hover:bg-accent/40"),children:[(0,s.jsx)(r.AccordionTrigger,{className:"flex-1 w-full",onClick:()=>j(!g),children:(0,s.jsx)("div",{className:"flex items-center justify-between w-full",children:(0,s.jsx)("span",{className:"mr-4",children:null==x?void 0:x.name})})}),(0,s.jsxs)(r.AccordionContent,{className:"px-2",children:[(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(t.x,{isToolResult:!0,children:(0,s.jsx)(t.BotMessage,{content:m,enableCitations:!0})})}),(0,s.jsx)(c.Z,{lender:y,isAnonymous:!(null===(n=p.user)||void 0===n?void 0:n.email),program:x,searchSources:f,query:v,eligibleQualifiers:h,readOnly:N})]}),(0,s.jsx)(d.Z,{isOpen:b,onClose:()=>w(!1),failedTimeRestriction:null!==(u=null===(l=p.userMessageRestrictions)||void 0===l?void 0:l.timeRestrictions.find(e=>{var n;return e.userData&&!(null===(n=e.userData)||void 0===n?void 0:n.passes)}))&&void 0!==u?u:null})]}):null}}}]);
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.