https://app.trustandwill.com/_next/static/chunks/pages/assets/[assetType]/[guid]-c1178c99bc362a40.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[886],{15241:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var a=i(37876),n=i(84552),s=i(95862),l=i(21401);function r(e){let{isOpen:t,onClose:i,onDiscard:r,minWidth:o=480,instant:d}=e,c=()=>{i()};return t&&(0,a.jsx)(l.A,{isOpen:t,data:{title:"Discard changes?"},settings:{role:"discard_changes",maxWidth:512,minWidth:o,disableClose:!1},onClose:c,hasChildForm:!0,instant:d,children:(0,a.jsx)(n.A,{isInModalBody:!0,children:(0,a.jsxs)("div",{className:"space-x-3 flex",children:[(0,a.jsx)(s.$,{type:"button",id:"keep-editing","data-testid":"keep-editing",variant:"outline",size:"lg",onClick:c,children:"Keep editing"}),(0,a.jsx)(s.$,{id:"discard","data-testid":"discard",type:"submit",variant:"primary",size:"lg",onClick:r,children:"Discard"})]})})})}},15261:(e,t,i)=>{"use strict";i.d(t,{A:()=>M});var a=i(46045),n=i(16690),s=i(37876),l=i(14232),r=i(67768),o=i(40097),d=i(93052),c=i(91153),u=i(69581),m=i(11781),p=i(20158),f=i(53601),h=i(40267),y=i(11580),v=i(11103),_=i(40255),x=i(69607),g=i(18961),b=i(84552),E=i(35280),S=i(41427),j=i(79316),N=i(95862);function A(e){let{bodyText:t,infoBox:i,ctaText:r,existingGiftData:o={isGiftDesignated:!1,firstGiftRecipient:null,secondGiftRecipient:null},handleSubmit:d,handleClose:c}=e,{decrement:u}=(0,x.QR)(),m={isGift:o.isGiftDesignated,generalErrorMessage:null,firstGiftRecipient:o.firstGiftRecipient,firstGiftRecipientError:null,isSecondGiftRecipient:!!o.secondGiftRecipient,secondGiftRecipient:o.secondGiftRecipient,secondGiftRecipientError:null,ctaLoading:!1},[p,f]=(0,l.useReducer)((e,t)=>{switch(t.type){case"SET_GIFT":return(0,n._)((0,a._)({},e),{isGift:t.payload,generalErrorMessage:null});case"SET_NO_CHOICE_ERROR":return(0,n._)((0,a._)({},e),{generalErrorMessage:"Please select an option"});case"SET_FIRST_RECIPIENT_NAME":return(0,n._)((0,a._)({},e),{firstGiftRecipient:t.payload,firstGiftRecipientError:null});case"SET_FIRST_RECIPIENT_ERROR":return(0,n._)((0,a._)({},e),{firstGiftRecipientError:"Required"});case"SET_SECOND_RECIPIENT_NAME":return(0,n._)((0,a._)({},e),{secondGiftRecipient:t.payload,secondGiftRecipientError:null});case"ADD_SECOND_RECIPIENT":return(0,n._)((0,a._)({},e),{isSecondGiftRecipient:!0});case"REMOVE_SECOND_RECIPIENT":return(0,n._)((0,a._)({},e),{isSecondGiftRecipient:!1,secondGiftRecipient:null,secondGiftRecipientError:null});case"SET_SECOND_RECIPIENT_ERROR":return(0,n._)((0,a._)({},e),{secondGiftRecipientError:"Required"});default:return e}},m);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-10",children:[(0,s.jsx)("p",{children:t}),i&&(0,s.jsx)("div",{className:"mt-5",children:(0,s.jsx)(E.Y,{id:"info-box",variant:null==i?void 0:i.level,message:null==i?void 0:i.mainText})}),(0,s.jsxs)("div",{className:"w-full mt-6",children:[(0,s.jsx)(S.m,{id:"yn-is-gift",onChange:e=>{f({type:"SET_GIFT",payload:"false"!==e})},options:[{label:"No",value:"false"},{label:"Yes",value:"true"}],value:p.isGift?"true":"false"}),null===p.isGift&&p.generalErrorMessage&&(0,s.jsx)(E.Y,{id:"is-gift-box",variant:"error",message:p.generalErrorMessage})]}),(0,s.jsxs)("div",{className:"w-full mt-6",children:[p.isGift&&(0,s.jsx)(j.A,{id:"first_gift_recipient",name:"first_gift_recipient","data-testid":"first_gift_recipient",label:"Gift Recipient",value:p.firstGiftRecipient,onChange:e=>{f({type:"SET_FIRST_RECIPIENT_NAME",payload:e.currentTarget.value})},errorMessage:p.firstGiftRecipientError?String(p.firstGiftRecipientError):void 0,placeholder:"John Doe",disabled:!1}),p.isGift&&!p.isSecondGiftRecipient&&(0,s.jsx)(N.$,{id:"add-second-gift-recipient","data-testid":"add-second-gift-recipient",size:"sm",variant:"ghost",onClick:()=>f({type:"ADD_SECOND_RECIPIENT"}),children:"Add a recipient"}),p.isGift&&p.isSecondGiftRecipient&&(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(j.A,{id:"second_gift_recipient",name:"second_gift_recipient","data-testid":"second_gift_recipient",label:"Gift Recipient",value:p.secondGiftRecipient,onChange:e=>{f({type:"SET_SECOND_RECIPIENT_NAME",payload:e.currentTarget.value})},errorMessage:p.secondGiftRecipientError?String(p.secondGiftRecipientError):void 0,placeholder:"John Doe",disabled:!1})}),p.isGift&&p.isSecondGiftRecipient&&(0,s.jsx)(N.$,{id:"remove-gift-recipient","data-testid":"remove-gift-recipient",size:"sm",variant:"ghost",onClick:()=>f({type:"REMOVE_SECOND_RECIPIENT"}),className:"-ml-3 mt-2",children:"Remove recipient"})]})]}),(0,s.jsx)(b.A,{hasBackButton:!0,backButton:(0,s.jsx)(N.$,{variant:"secondary",type:"button",id:"back","data-testid":"back",size:"lg",onClick:()=>u(),children:"Back"}),isInModalBody:!0,children:(0,s.jsxs)("div",{className:"space-x-3 flex",children:[(0,s.jsx)(N.$,{type:"button",id:"designate-asset-gift-cancel","data-testid":"designate-asset-gift-cancel",variant:"outline",size:"lg",loading:!1,onClick:()=>c(),children:"Cancel"}),(0,s.jsx)(N.$,{id:"designate-asset-gift-submit","data-testid":"designate-asset-gift-submit",type:"submit",variant:"primary",size:"lg",loading:!1,disabled:!1,onClick:e=>{if(e.preventDefault(),null!==p.isGift)if(p.isGift){let e;e=!0,null!==p.firstGiftRecipient&&p.firstGiftRecipient.trim()||(e=!1,f({type:"SET_FIRST_RECIPIENT_ERROR"})),p.isSecondGiftRecipient&&(null===p.secondGiftRecipient||!p.secondGiftRecipient.trim())&&(e=!1,f({type:"SET_SECOND_RECIPIENT_ERROR"})),e&&d({is_gift:p.isGift,first_gift_recipient:p.firstGiftRecipient,second_gift_recipient:p.secondGiftRecipient})}else d({is_gift:p.isGift,first_gift_recipient:null,second_gift_recipient:null});else f({type:"SET_NO_CHOICE_ERROR"})},children:r||"Add asset"})]})})]})}var T=i(80306),I=i(82650),C=i(25349),R=i(52252),w=i(1444),k=i(21401),D=i(63176),O=i(45444),G=i(58505);function M(e){let{data:t,assetType:i,isOpen:b,onClose:E,spouseName:S,principalUserName:j,isTrust:N,trusts:M,estateInventoryItemTypes:B}=e,{getEstateInventoryItemCategoryNameById:P}=(0,v.Ay)(),{setIndex:F}=(0,x.QR)(),U=(0,r.jE)(),[q,L]=(0,l.useState)({}),[z,W]=(0,l.useState)(b),[Q,K]=(0,l.useState)(!1),[V,$]=(0,l.useState)(t),[Y,H]=(0,l.useState)(!1),X=()=>{W(!1),E()},Z=(0,l.useMemo)(()=>(0,h.Ll)(V),[V]),{mutate:J}=(0,o.n)({mutationFn:c.VD,onSuccess:async e=>{var s,l;(e.data.is_gift||N)&&(0,f.Ay)(U),await U.invalidateQueries({queryKey:[...p.I.ASSET_DETAIL,{guid:V.guid}]}),await U.invalidateQueries({queryKey:p.I.ASSETS}),await U.invalidateQueries({queryKey:p.I.ESTATE_INVENTORY_DASHBOARD_DATA}),"financial-accounts"===i&&await U.invalidateQueries({queryKey:p.I.INSIGHTS_WIDGET});let r=t.value||t.approx_value||t.amount||"0",o=parseInt(e.data.value||e.data.approx_value||e.data.amount||"0")-parseInt(r);if(U.getQueryData(p.I.ASSETS_WIDGET)&&0!==o){let t=(Array.isArray(i)?i[0]:i).replace("-","_");"ancillary"===t&&(t=(0,f.LV)(e.data.estate_inventory_item_type_id)?"business_interests":"other"),U.setQueryData(p.I.ASSETS_WIDGET,e=>{let i=e.total_values[t]+o;return(0,n._)((0,a._)({},e),{total_values:(0,n._)((0,a._)({},e.total_values),{[t]:i})})})}let d=!!(null==(l=V.additional_owners)||null==(s=l[0])?void 0:s.business_data),c=d?P(V.additional_owners[0].business_data.estate_inventory_item_type_id):null;(0,g.P0)("success",{id:"edit-asset-toast",label:d&&c?"".concat((0,_.zX)(Z)," updated and ").concat(c.toLowerCase()," added"):"".concat((0,_.zX)(Z)," updated")}),(0,y.A)("edit-asset-toast-dismiss"),X()}});(0,l.useEffect)(()=>
1{if(Y){let n=(0,a._)({},V);if(n.is_gift="is_gift"in n?!!n.is_gift:n.is_gift,"real-estate"!==i||n.address_line_two||(n.address_line_two=null),"ancillary"===i){var e;if(n.description||(n.description=null),n.value_of_ownership||(n.value_of_ownership=null),[m.CR.BUSINESS_INTEREST].includes(n.estate_inventory_item_type_id)){n.asset_sub_type_id=n.asset_sub_type_name?u.jn[n.asset_sub_type_name]:null;let t=null==(e=d.Og.find(e=>{var t;return e.value===(null==(t=n.relationship_to_business_id)?void 0:t.toString())}))?void 0:e.value;n.relationship_to_business_id=t?Number(t):null,delete n.business_relationship}}["amount","value","approx_value","state"].forEach(e=>{""===n[e]&&(n[e]=null),"number"==typeof n[e]&&(n[e]=String(n[e]))});let s=-1===n.trust_id?null:n.trust_id;n.meta=(0,h.Vs)(t,n,s),"plaid_institution_account"in n&&delete n.plaid_institution_account,delete n.trust_id,delete n.createdAt,delete n.updatedAt,delete n.estate_inventory_item,delete n.business_id,J({data:n,asset_segment:i})}},[V]);let ee=async e=>{await $(t=>(0,a._)({},t,e))},et={role:"Add an asset",maxWidth:512,showPrimaryCTA:!0,showSecondaryCTA:!0,showBackButton:!0},ei=e=>{H(!0),ee(e)},ea={isGiftDesignated:null==V?void 0:V.is_gift,firstGiftRecipient:null==V?void 0:V.first_gift_recipient,secondGiftRecipient:null==V?void 0:V.second_gift_recipient},en=async(e,t)=>(H(!0),await ee(t),G.l.SUCCESS),es=async(e,t)=>(H(!0),await ee(t||e),G.l.SUCCESS),el=[{content:(0,s.jsx)(R.A,{handleSave:en,onModalClose:E,spouseName:S,principalUserName:j,existingRealEstateData:V,isEdit:!0,isGift:V.is_gift&&!V.gift_id,trusts:M,onRequestBusinessDetails:e=>{K(!0),ee(e);let t=e=>{L([{content:(0,s.jsx)(R.A,{handleSave:en,onModalClose:E,spouseName:S,principalUserName:j,existingRealEstateData:e,isEdit:!0,isGift:V.is_gift&&!V.gift_id,trusts:M,onRequestBusinessDetails:e=>t(e)})},{content:(0,s.jsx)(D.Ay,{handleBackButtonClick:()=>F(0),handleSave:en,onModalClose:E,spouseName:S,trusts:M,isGift:!1,principalUserName:j,ownershipType:"direct",isBusinessAsOwner:!0,isEdit:!0})}]),F(1)};t(e)}})},{title:"Would you like to designate this property as a gift?",content:(0,s.jsx)(A,{bodyText:"Gifts are given to their designated recipient(s) before the rest of your estate is split and distributed to your beneficiaries. All gift designations will be noted in your estate planning documents.",handleSubmit:ei,ctaText:"Update property",handleClose:X,existingGiftData:ea})}],er=[{content:(0,s.jsx)(O.A,{handleSave:en,onModalClose:E,spouseName:S,principalUserName:j,existingBusinessData:V,isGift:!1,trusts:M,isEdit:!0})},{title:"Would you like to designate this business interest as a gift?",content:(0,s.jsx)(A,{bodyText:"Gifts are given to their designated recipient(s) before the rest of your estate is split and distributed to your beneficiaries. All gift designations will be noted in your estate planning documents.",infoBox:{level:"info",mainText:"Though uncommon, itâs best to check whether there are any restrictions or limitations on who can own this business interest before designating it as a gift."},ctaText:"Update business interest",handleSubmit:ei,handleClose:X,existingGiftData:ea})}],eo=[{content:(0,s.jsx)(C.A,{handleSave:en,existingOtherAssetData:V,onModalClose:E,spouseName:S,principalUserName:j,trusts:M,isGift:!1,onRequestBusinessDetails:e=>{K(!0),ee(e);let t=e=>{L([{content:(0,s.jsx)(C.A,{handleSave:en,existingOtherAssetData:e,onModalClose:E,spouseName:S,principalUserName:j,trusts:M,isGift:!1,onRequestBusinessDetails:e=>t(e)})},{content:(0,s.jsx)(D.Ay,{handleBackButtonClick:()=>F(0),handleSave:en,onModalClose:E,spouseName:S,trusts:M,isGift:!1,principalUserName:j,ownershipType:"direct",isBusinessAsOwner:!0})}]),F(1)};t(e)}})},{title:"Would you like to designate this asset as a gift?",content:(0,s.jsx)(A,{bodyText:"Gifts are given to their designated recipient(s) before the rest of your estate is split and distributed to your beneficiaries. All gift designations will be noted in your estate planning documents.",ctaText:"Update asset",handleSubmit:ei,handleClose:X,existingGiftData:ea})}],ed=[{content:(0,s.jsx)(I.A,{handleSave:es,onModalClose:E,spouseName:S,principalUserName:j,trusts:M,existingLifeInsuranceData:V,estateInventoryAccountItemTypes:B||[],isEdit:!0,onRequestBusinessDetail
1s:e=>{K(!0),ee(e);let t=e=>{L([{content:(0,s.jsx)(I.A,{handleSave:es,onModalClose:E,spouseName:S,principalUserName:j,trusts:M,existingLifeInsuranceData:e,estateInventoryAccountItemTypes:B||[],onRequestBusinessDetails:e=>t(e),isEdit:!0})},{content:(0,s.jsx)(D.Ay,{handleBackButtonClick:()=>F(0),handleSave:es,onModalClose:E,spouseName:S,trusts:M,isGift:!1,principalUserName:j,ownershipType:"direct",isBusinessAsOwner:!0,isEdit:!0})}]),F(1)};t(e)}})}],ec=(0,l.useMemo)(()=>[{content:(0,s.jsx)(T.A,{handleSave:es,onModalClose:E,spouseName:S,principalUserName:j,trusts:M,existingFinancialAccountData:V,isEdit:!0,estateInventoryAccountItemTypes:B||[],onRequestBusinessDetails:e=>{K(!0),ee(e);let t=e=>{L([{content:(0,s.jsx)(T.A,{handleSave:es,onModalClose:E,spouseName:S,principalUserName:j,trusts:M,existingFinancialAccountData:e,isEdit:!0,estateInventoryAccountItemTypes:B||[],onRequestBusinessDetails:e=>t(e)})},{content:(0,s.jsx)(D.Ay,{handleBackButtonClick:()=>F(0),handleSave:es,onModalClose:E,spouseName:S,trusts:M,isGift:!1,principalUserName:j,ownershipType:"direct",isBusinessAsOwner:!0,isEdit:!0})}]),F(1)};t(e)}})}],[es,B,V,E,S,M]),eu={content:(0,s.jsx)(w.A,{handleSave:en,onModalClose:E,handleBackButtonClick:()=>{},spouseName:S,principalUserName:j,existingVehicleData:V,isEdit:!0,trusts:M,onRequestBusinessDetails:e=>{K(!0),ee(e);let t=e=>{L([{content:(0,s.jsx)(w.A,{handleSave:en,onModalClose:E,handleBackButtonClick:()=>F(0),spouseName:S,principalUserName:j,existingVehicleData:e,isEdit:!0,trusts:M,onRequestBusinessDetails:e=>t(e)})},{content:(0,s.jsx)(D.Ay,{handleBackButtonClick:()=>F(0),handleSave:en,onModalClose:E,spouseName:S,trusts:M,isGift:!1,isEdit:!0,principalUserName:j,ownershipType:"direct",isBusinessAsOwner:!0})}]),F(1)};t(e)}})};return((0,l.useEffect)(()=>{switch(F(0),i){case"real-estate":K(!0),L(el);break;case"financial-accounts":K(!0),L(ec);break;case"life-insurance":K(!0),L(ed);break;case"vehicle":K(!0),L(eu);break;case"ancillary":[m.CR.BUSINESS_INTEREST,m.CR.DIRECT_BUSINESS_OWNERSHIP,m.CR.PASSIVE_BUSINESS_OWNERSHIP].includes(V.estate_inventory_item_type_id)?(K(!0),L(er)):(K(!0),L(eo))}},[]),z)?(0,s.jsx)(k.A,{maxWidth:et.maxWidth,isOpen:z,hasChildForm:Q,settings:et,data:q,onClose:X,children:z&&null}):null}},17514:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>eS});var a=i(46045),n=i(16690),s=i(37876),l=i(89099),r=i(14232),o=i(67768),d=i(2491),c=i(40097),u=i(18961),m=i(61324),p=i(956),f=i(97891),h=i(20158),y=i(75731),v=i(40267),_=i(40255),x=i(95402),g=i(86963),b=i(17260),E=i(15315),S=i(2005),j=i(91153),N=i(69607),A=i(11781),T=i(98924),I=i(77143),C=i(40239),R=i(65307),w=i(63029),k=i(21442),D=i(24155),O=i(53601),G=i(11103),M=i(35860),B=i(10399),P=i(89120),F=i(71481),U=i(80907),q=i(15261),L=i(57995),z=i(19646),W=i(78386),Q=i(42493),K=i(51742),V=i(95862);function $(e){let{setIsBeneficiaryModalOpen:t,beneficiaries:i,deleteAllBeneficiaries:a,itemCategory:n}=e,[l,o]=(0,r.useState)(!1),d=(0,r.useMemo)(()=>(null==i?void 0:i.length)>0,[i]),c=(0,r.useMemo)(()=>null==i?void 0:i.sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()),[i]),u=(0,r.useMemo)(()=>["vehicle","real-estate"].includes(n),[n]),m=(0,r.useMemo)(()=>"vehicle"===n?"Ensure this beneficiary list matches your vehicle title. Changes here won't affect asset distribution. This is for reference and insights only.":"life-insurance"===n?"Ensure this beneficiary list matches your life insurance policy records. Changes here won't affect asset distribution. This is for reference and insights only.":"real-estate"===n?"Ensure this beneficiary list matches your recorded real estate Transfer on Death Deed (TODD). Changes here won't affect asset distribution. This is for reference and insights only.":"Ensure this beneficiary list matches your financial institution's records. Changes here won't affect asset distribution. This is for reference and insights only.",[n]);return(0,s.jsxs)(s.Fragment,{children:[l&&(0,s.jsx)(K.A,{isOpen:l,onClose:()=>o(!1),onConfirmAction:()=>{o(!1),a(i[0].estate_inventory_item_id)},title:"Delete beneficiary list?",confirmButtonText:"Delete",description:"This action cannot be undone.",children:(0,s.jsx)(Q.o,{variant:"body-md",as:"p",children:"This will delete all benef
1iciaries from the list. Changes here wonât affect asset distribution. This is for reference and insights only."})}),(0,s.jsx)(F.A,{title:"Beneficiary list",children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-center sm:absolute sm:right-0 sm:top-[-4.25rem] mb-8",children:[d&&(0,s.jsxs)("div",{className:"flex flex-col justify-center gap-2 sm:flex-row w-full",children:[(0,s.jsx)(V.$,{className:"w-full sm:w-auto",id:"delete-beneficiary-list","data-testid":"delete-beneficiary-list",variant:"outline",size:"lg","data-track":"bene-delete",onClick:()=>o(!0),children:"Delete"}),(0,s.jsx)(V.$,{className:"w-full sm:w-auto",id:"edit-beneficiary-list","data-testid":"edit-beneficiary-list",variant:"outline",size:"lg","data-track":"bene-update",onClick:()=>t(!0),children:"Edit"})]}),!d&&(0,s.jsx)(V.$,{className:"w-full sm:w-auto",id:"add-beneficiary-list","data-testid":"add-beneficiary-list",variant:"outline",size:"lg","data-track":"bene-add",onClick:()=>t(!0),children:"Add"})]}),!d&&(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsxs)("div",{className:"max-w-md",children:[(0,s.jsx)(Q.o,{variant:"body-md-bold",as:"h4",className:"relative text-center",children:"Add a beneficiary list"}),(0,s.jsx)(Q.o,{variant:"body-md",as:"p",className:"text-center !text-foreground-secondary",children:m})]})}),d&&(0,s.jsxs)("div",{children:[c.map(e=>(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"flex flex-col justify-start mb-4",children:[(0,s.jsx)(Q.o,{variant:"body-md-bold",as:"h4",className:"relative",children:e.name}),(0,s.jsx)(Q.o,{className:"!text-foreground-secondary",variant:"body-md",as:"p",children:u?"":"".concat(e.percent,"%")})]})},e.id)),(0,s.jsx)(Q.o,{className:"mt-6 !text-foreground-secondary",variant:"body-sm",as:"p",children:m})]})]})})]})}var Y=i(74811),H=i(84552),X=i(21401);function Z(e){let{isOpen:t,onClose:i,onRemovePlaidInstitution:a,plaidLinkedItemId:n}=e,l=async()=>{await (0,m.V)({id:"opportunity-mark-as-done-toast",loading:{label:"Removing institution..."},promise:async()=>{let e=await (0,j.vl)(n);if((null==e?void 0:e.message)!=="Linked item removed")throw Error("Failed to remove Plaid institution")},success:{label:"Institution removed"},error:{label:"Failed to remove institution"}}),a()};return(0,s.jsxs)(X.A,{isOpen:t,data:{title:"Remove institution?"},settings:{role:"Modal to remove a Plaid institution",maxWidth:512,disableClose:!1,isDestructive:!0},onClose:i,hasChildForm:!0,children:["Removing this financial institution will also delete all linked accounts. This action cannot be undone.",(0,s.jsx)(H.A,{isInModalBody:!0,children:(0,s.jsxs)("div",{className:"space-x-3 flex",children:[(0,s.jsx)(V.$,{id:"remove-plaid-institution-cancel","data-testid":"remove-plaid-institution-cancel",type:"button",variant:"outline",size:"lg",onClick:()=>{i()},children:"Cancel"}),(0,s.jsx)(V.$,{id:"remove-plaid-institution-submit","data-testid":"remove-plaid-institution-submit",type:"submit",variant:"primary",size:"lg",onClick:l,children:"Remove"})]})})]})}var J=i(85294),ee=i(75784),et=i(34417),ei=i(2918),ea=i(84759),en=i(79316),es=i(24443);let el=[T.A.ME_AND_MY_SPOUSE_JOINTLY,T.A.SPOUSE,T.A.SPOUSE_AND_SOMEONE_ELSE,T.A.ME_AND_MY_SPOUSE_SEPARATELY];function er(e){var t,i;let{field:l,index:o,onChange:d,onRemove:c,hasError:u,setErrorIndexes:m,errorIndexes:p,canRemove:f,hidePercent:h=!1,ownershipTypeId:y}=e,v=null!=y&&el.includes(y),_=(e,t)=>{"string"==typeof e&&void 0!==t?d(o,(0,n._)((0,a._)({},l),{[e]:t})):"object"==typeof e&&d(o,(0,a._)({},l,e))},{principalUserName:x,spouseName:g}=(0,ea.A)(),b=(0,r.useRef)(null!=(t=l.name)?t:""),E=(0,r.useRef)(null!=(i=l.person_id)?i:null);return(0,s.jsxs)("div",{className:"flex flex-col mb-6 border border-divider rounded-lg bg-background-card",children:[(0,s.jsxs)("div",{className:"p-4 flex flex-row justify-between",children:[(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)(Q.o,{variant:"body-md-bold",className:"text-center",children:["Beneficiary"," ",o+1]})}),(0,s.jsx)(V.$,{id:"remove-beneficiary","data-testid":"remove-beneficiary",variant:"ghost",size:"sm",onClick:()=>{f?c(o):_({name:"",percent:"",person_id:null})},children:"Remove"})]}),(0,s.jsx)("hr",{className:"border-divider"}),(0,s.jsxs)("div",{className:"p-4 flex flex-col gap-4",children:[(0,s.jsx)(ei.A,{showError:u,nameQuery:l.name,inputName:"name",value:l.name,onOptionSelected:(e,t)=>{_({name:e,person_id:(null==t?void 0:t.id)||null}),b.current=e,E.current=(null==t?void 0:t.id)||null,m(p.filter(e=>e!==o))},onUnmatchedBlur:()=>_({name:b.current,person_id:E.current}),principalUserName:x,spouseName:g,includeSpouse:!v,children:(0,s.jsx)(en.A,{id:"benef
1iciary-name-".concat(o),name:"beneficiary-name-".concat(o),"data-testid":"beneficiary-name-".concat(o),label:"Full name",value:l.name,onChange:e=>{_("name",e.target.value),m(p.filter(e=>e!==o))},errorMessage:u?"Required":void 0})}),!h&&(0,s.jsx)(es.C,{id:"beneficiary-percent-".concat(o),"data-testid":"beneficiary-percent-".concat(o),label:"Percent",value:null==l.percent?void 0:Number(l.percent),onChange:e=>{let t=parseFloat(e);if(Number.isNaN(t))return void _("percent","");_("percent",(t>100?100:Math.max(0,t)).toString())},min:0,max:100})]})]})}function eo(e){let{beneficiaries:t,setBeneficiaries:i,errorIndexes:l,setErrorIndexes:o,currentTotalPercentage:d,hasSubmitted:c,estateInventoryItemId:m,userId:p,itemCategory:f,ownershipTypeId:h}=e,y=(e,s,l)=>{let r=[...t];"string"==typeof s&&void 0!==l?r[e]=(0,n._)((0,a._)({},r[e]),{[s]:l}):"object"==typeof s&&(r[e]=(0,a._)({},r[e],s)),i(r)},v=(0,r.useMemo)(()=>["vehicle","real-estate"].includes(f),[f]),_=e=>{let a=[...t];a.splice(e,1),i(a)},x=100===d,g=(0,r.useMemo)(()=>t.length>1,[t]);return(0,s.jsxs)("div",{className:"w-full relative",children:[(0,s.jsx)(ee.N,{mode:"popLayout",children:(0,s.jsx)("div",{className:"relative z-[100]",children:t.map((e,t)=>(0,s.jsx)(et.P.div,{className:"relative z-0 focus-within:z-9999",initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:24},exit:{opacity:0,height:0,marginBottom:0},transition:{duration:.2},children:(0,s.jsx)(er,{field:e,index:t,onChange:y,onRemove:_,hasError:l.includes(t),setErrorIndexes:o,errorIndexes:l,canRemove:g,hidePercent:v,ownershipTypeId:h})},"".concat((null==e?void 0:e.id)||t)))})}),!v&&(0,s.jsx)("div",{className:"relative z-[2] flex justify-end mt-2 ".concat(!x&&c?"mb-0":"mb-6"),children:(0,s.jsxs)(Q.o,{variant:"body-md-bold",as:"p",children:["Percent total:"," ",d.toFixed(2),"%"]})}),!v&&!x&&c&&(0,s.jsx)("div",{className:"flex justify-end mt-2 mb-6",children:(0,s.jsx)(Q.o,{className:"!text-status-danger-text",variant:"body-md-bold",as:"p",children:"Percent total must equal 100.00%"})}),(0,s.jsx)("div",{className:"flex justify-center relative z-[1]",children:(0,s.jsx)(V.$,{variant:"outline",id:"add-another-beneficiary","data-testid":"add-another-beneficiary",rounded:!0,onClick:()=>"vehicle"===f&&t.length>
1=5?void(0,u.P0)("info",{id:"beneficiary-limit-toast",label:"Maximum of 5 beneficiaries reached. Remove one to add another."}):t.length>=50?void(0,u.P0)("info",{id:"beneficiary-limit-toast",label:"Maximum of 50 beneficiaries reached. Remove one to add another."}):void i([...t,{name:"",percent:"0",estate_inventory_item_id:m,user_id:p,person_id:null}]),size:"lg",children:"Add another beneficiary"})})]})}var ed=i(15241);function ec(e){var t,i,l,o;let{isOpen:d,onClose:c,assetData:m,userData:p,mutateCreateItemBeneficiaries:f,mutateEditItemBeneficiaries:h,estateInventoryItemBeneficiaries:y,itemCategory:v}=e,_="vehicle"===v||"real-estate"===v,[x,g]=(0,r.useState)(!1),[b,E]=(0,r.useState)(!1),S=(null==y?void 0:y.length)>0,[j,N]=(0,r.useState)(S?y:[{name:"",percent:_?null:"0",estate_inventory_item_id:(null==m||null==(t=m.data)?void 0:t.estate_inventory_item_id)||null,user_id:(null==p?void 0:p.id)||null,person_id:null}]),[A,T]=(0,r.useState)([]),[I,C]=(0,r.useState)(!1),[R,w]=(0,r.useState)(!1),[k,D]=(0,r.useState)(d),O=()=>{D(!1),c()},G={role:"Add an asset",maxWidth:512,showPrimaryCTA:!0,showSecondaryCTA:!0,showBackButton:!0},M=e=>{if(!e)return 0;let t=e;return"string"==typeof t&&(t=parseFloat(null==t?void 0:t.replace("%",""))),Number.isNaN(t)&&(t=0),t},B=(0,r.useMemo)(()=>(j||[]).reduce((e,t)=>e+M(t.percent),0),[j]),P=async()=>{C(!0),w(!0);try{let e=_||100===B,t=(()=>{let e=[];return j.forEach((t,i)=>{t.name.trim()||e.push(i)}),T(e),0===e.length})();if(e&&t){let e=j.map(e=>{let t=(0,n._)((0,a._)({},e),{percent:_?null:M(e.percent)});return null===t.person_id&&delete t.person_id,t});S?await h(e):await f(e),O()}}catch(e){(0,u.P0)("error",{id:"estate-inventory-item-beneficiaries-error",label:"Failed to update beneficiary list"})}w(!1)},F=(0,r.useMemo)(()=>{var e;let t={title:"Who does ".concat((null==m||null==(e=m.data)?void 0:e.name)||"the financial institution"," have listed as the beneficiary for this account?"),subText:"Ensure this beneficiary list matches your financial institution's records. Changes here won't affect asset distribution. This is for reference and insights only."};return"vehicle"===v?{title:"Who is listed on your vehicle title as the beneficiary?",subText:(0,s.jsxs)(s.Fragment,{children:["Ensure this"," ",(0,s.jsx)(J.m,{content:"Someone named on your vehicle title who automatically inherits the car when you pass away, avoiding probate.",id:"vehicle-beneficiary-modal-tooltip",children:(0,s.jsx)(Q.o,{variant:"body-md",underline:!0,children:"beneficiary"})})," ","list matches your vehicle title. Changes here won't affect asset distribution. This is for reference and insights only."]})}:"life-insurance"===v?{title:"Who is listed as the beneficiary on file with the life insurance provider for this policy?",subText:"Ensure this beneficiary list matches your life insurance policy records. Changes here wonât affect asset distribution. This is for reference and insights only."}:"real-estate"===v?{title:"Who is listed as the beneficiary on the recorded Transfer on Death Deed (TODD) for this property?",subText:"Ensure this beneficiary list matches your recorded real estate Transfer on Death Deed (TODD). Changes here won't affect asset distribution. This is for reference and insights only."}:t},[v,null==m||null==(i=m.data)?void 0:i.name]);return(0,s.jsxs)(s.Fragment,{children:[b&&(0,s.jsx)(ed.A,{isOpen:b,onClose:()=>E(!1),onDiscard:()=>{E(!1),O()},minWidth:280}),(0,s.jsx)(X.A,{maxWidth:G.maxWidth,isOpen:k,settings:G,data:{title:F.title,widthSize:"512"},onClose:O,hasChildForm:!0,children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{children:(0,s.jsx)(Q.o,{variant:"body-md",as:"p",children:F.subText})}),(0,s.jsx)(Q.o,{className:"mb-4 mt-6",variant:"body-lg",weight:"bold",as:"h6",children:"Beneficiaries"}),(0,s.jsx)(eo,{beneficiaries:j,setBeneficiaries:e=>{x||g(!0),N(e)},errorIndexes:A,setErrorIndexes:T,currentTotalPercentage:B,hasSubmitted:I,estateInventoryItemId:null==m||null==(l=m.data)?void 0:l.estate_inventory_item_id,userId:null==p?void 0:p.id,itemCategory:v,ownershipTypeId:null==m||null==(o=m.data)?void 0:o.ownership_type_id}),(0,s.jsx)(H.A,{isInModalBody:!0,children:(0,s.jsxs)("div",{className:"space-x-3 flex",children:[(0,s.jsx)(V.$,{type:"button",id:"cancel","data-testid":"cancel",variant:"outline",size:"lg",onClick:()=>{x?E(!0):O()},children:"Cancel"}),(0,s.jsx)(V.$,{id:"next","data-testid":"next",type:"button",variant:"primary",size:"lg",loading:R,onClick:P,children:S?"Update":"Add"})]})})]})})]})}var eu=i(55940),em=i(50492),ep=i(40050),ef=i(72458);function eh(){return(0,s.jsxs)(ef.A,{children:[(0,s.jsx)(ep.A,{children:"Name"}),(0,s.jsx)(ep.A,{displayAt:"md",children:"Type"}),(0,s.jsx)(ep.A,{screenReaderOnly:!0,children:"action"})]})}var ey=i(65384),ev=i(35641),e_=i(98753),ex=i(52495);function eg(e){let{rowData:t}=e,i=(0,b.useAuth)(),a=(0,ev.A)("lg"),[n,l]=(0,r.useState)(!1),o=(0,ev.A)("md"),{documentId:d,fileName:c,fileType:u}=t,m=()=>{i.navigateToRoute({route:"".concat(y.Dv.DOCUMENTS_OTHER,"/").concat(d)})};return(0,s.jsxs)(e_.A,{clickAction:d?m:null,handleSetHoverState:l,children:[(0,s.jsxs)(ex.A,{smallPadding:!0,width:"w-full",children:[(0,s.jsx)(Q.o,{variant:"body-md-bold",truncate:!0,children:c}),!o&&u&&(0,s.jsx)(Q.o,{variant:"body-md",as:"div",children:u})]}),u&&(0,s.jsx)(ex.A,{smallPadding:!0,displayAt:"md",width:"whitespace-nowrap",children:(0,s.jsx)(Q.o,{variant:"body-md",children:u})}),(0,s.jsx)(ex.A,{smallPadding:!0,align:"right",children:d&&(0,s.jsx)("button",{type:"button","aria-label":"View ".concat(c),className:(0,ey.A)("m-0 inline-flex min-w-0 items-center justify-center appearance-none p-0","focus:opacity-100",!a||n?"o
1pacity-100":"opacity-0"),onClick:e=>{e.stopPropagation(),m()},children:(0,s.jsx)(f.I,{className:"m-0",name:"chevron-right",variant:"outlined",size:"md"})})})]},"asset-table-row-".concat(c))}function eb(e){let{otherDocumentsTableData:t,srOnlyCaption:i}=e,a=[...t].sort((e,t)=>e.fileName.localeCompare(t.fileName,void 0,{sensitivity:"base"}));return(0,s.jsxs)(em.A,{children:[i&&(0,s.jsx)("caption",{className:"sr-only",children:i}),(0,s.jsx)(eh,{}),a.map(e=>(0,s.jsx)(eg,{rowData:e},"document-table-row-".concat(e.documentId)))]})}var eE=i(88702);function eS(){var e,t,i,D,Q,K,V,H,X,J,ee,et,ei,ea,en,es,el,er,eo,ed,em,ep,ef,eh,ey,ev,e_,ex,eg,eS,ej;let eN=(0,b.useAuth)(),eA=(0,l.useRouter)(),eT=(0,o.jE)(),eI=null==(e=eT.getQueryState(h.I.GLOBALS))?void 0:e.data,eC=null==eI||null==(i=eI.principal)||null==(t=i.user)?void 0:t.product_trust,[eR,ew]=(0,r.useState)(null),[ek,eD]=(0,r.useState)(!1),[eO,eG]=(0,r.useState)(!1),[eM,eB]=(0,r.useState)(!1),[eP,eF]=(0,r.useState)(!1),[eU,eq]=(0,r.useState)(!1),[eL,ez]=(0,r.useState)(!1),[eW,eQ]=(0,r.useState)(!1),[eK,eV]=(0,r.useState)(!1),{setIndex:e$}=(0,N.QR)(),{handlePlaidError:eY}=(0,M.A)(),{assetType:eH,guid:eX}=eA.query,{data:eZ}=(0,d.I)({queryKey:h.I.ESTATE_INVENTORY_ITEM_BENEFICIARIES,queryFn:()=>(0,j.BZ)()}),{data:eJ,refetch:e0}=(0,d.I)({queryKey:h.I.ASSETS,queryFn:j.FX,retry:!1}),{data:e1,isLoading:e5,isError:e4,refetch:e2}=(0,d.I)({queryKey:[...h.I.ASSET_DETAIL,{guid:eX}],queryFn:async()=>await (0,j.xs)(eH,eX),retry:!1,refetchOnMount:"always"}),e6=(0,r.useMemo)(()=>eZ?null==eZ?void 0:eZ.filter(e=>{var t;return e.estate_inventory_item_id===(null==e1||null==(t=e1.data)?void 0:t.estate_inventory_item_id)}):[],[eZ,e1]),e7=(0,r.useMemo)(()=>{if(null==e1?void 0:e1.data.plaid_institution_account){var e,t;let i=null==e1||null==(e=e1.data.plaid_institution_account)?void 0:e.plaid_linked_item;return null!=(t=null==i?void 0:i.action_required)?t:null}return null},[e1]),{estateInventoryItemTypesTree:e9,getAccountItemCategoryLabel:e8,hasParentType:e3}=(0,G.Ay)(),{data:te}=(0,d.I)({queryKey:h.I.OTHER_DOCUMENTS,queryFn:S.fe}),tt=(eg=null==te||null==(D=te.data)?void 0:D.data,eS=eX.toString(),eg?eg.filter(e=>{var t;return(null==(t=e.meta)?void 0:t.asset_id)===eS}).map(e=>({fileName:e.name,documentId:e._id})):[]),ti=null==eI||null==(K=eI.principal)||null==(Q=K.user)?void 0:Q.has_active_subscription,{data:ta}=(0,R.A)(),tn=(0,w.A)(C.e.DD_152_PRO_TIER_LAUNCH),ts=void 0!==tn&&void 0!==ta,tl=tn&&(0,g.Qp)(ta,I.t.DOCUMENT_EDITOR),tr=ts&&!ti&&!tl,to=(0,r.useMemo)(()=>(0,O.Ae)(eI),[eI]),{mutateAsync:td}=(0,c.n)({mutationFn:j.hi,onSuccess:e=>{eT.setQueryData(h.I.ESTATE_INVENTORY_ITEM_BENEFICIARIES,t=>[...t,...e]),eT.invalidateQueries({queryKey:[...h.I.ASSET_DETAIL,{guid:eX}]}),(0,u.P0)("success",{id:"estate-inventory-item-beneficiaries-created",label:"Beneficiary list updated"})},onError:()=>{(0,u.P0)("error",{id:"estate-inventory-item-beneficiaries-created-error",label:"Failed to update beneficiary list"})}}),{mutateAsync:tc}=(0,c.n)({mutationFn:j.$1,onSuccess:()=>{eT.invalidateQueries({queryKey:h.I.ESTATE_INVENTORY_ITEM_BENEFICIARIES}),eT.invalidateQueries({queryKey:h.I.PEOPLE}),(0,u.P0)("success",{id:"estate-inventory-item-beneficiaries-edited",label:"Beneficiary list updated"})},onError:()=>{(0,u.P0)("error",{id:"estate-inventory-item-beneficiaries-edited-error",label:"Failed to update beneficiary list"})}}),{mutateAsync:tu}=(0,c.n)({mutationFn:j.az,onSuccess:()=>{eT.invalidateQueries({queryKey:h.I.ESTATE_INVENTORY_ITEM_BENEFICIARIES}),eT.invalidateQueries({queryKey:h.I.PEOPLE}),(0,u.P0)("success",{id:"estate-inventory-item-beneficiaries-deleted",label:"Beneficiary list deleted"})},onError:()=>{(0,u.P0)("error",{id:"estate-inventory-item-beneficiaries-deleted-error",label:"Failed to delete beneficiary list"})}}),tm=(0,r.useMemo)(()=>(0,v.Ll)(null==e1?void 0:e1.data),[e1]),tp=async()=>{var e;if(await (0,j.Z4)(eH,eX),(0,O.Ay)(eT),e3(null==e1||null==(e=e1.data)?void 0:e.estate_inventory_item_type_id,{name:"loan"})&&(eT.invalidateQueries({predicate:e=>{let{queryKey:t}=e;return t.includes(h.I.ESTATE_INVENTORY_LINKED_ITEMS[0])}}),eT.refetchQueries({queryKey:[...h.I.ESTATE_INVENTORY_LINKABLE_ITEMS,j.HM.LOANS]})),(0,u.P0)("success",{id:"inventory-item-deleted-toast",label:"".concat((0,_.zX)(tm)," deleted")}
1),eT.invalidateQueries({queryKey:h.I.ASSETS}),eT.invalidateQueries({queryKey:h.I.ESTATE_INVENTORY_DASHBOARD_DATA}),eT.invalidateQueries({queryKey:h.I.INSIGHTS_WIDGET,refetchType:"none"}),eT.getQueryData(h.I.ASSETS_WIDGET)){let e=(Array.isArray(eH)?eH[0]:eH).replace("-","_");"ancillary"===e&&(e=(0,O.LV)(e1.data.estate_inventory_item_type_id)?"business_interests":"other");let t=e1.data.value||e1.data.approx_value||e1.data.amount||0;eT.setQueryData(h.I.ASSETS_WIDGET,i=>{let s=i.total_number_of_assets[e]-1,l=i.total_values[e]-parseInt(t);return{total_number_of_assets:(0,n._)((0,a._)({},i.total_number_of_assets),{[e]:s}),total_values:(0,n._)((0,a._)({},i.total_values),{[e]:l})}})}eN.navigateToRoute({route:"/assets"})},tf=()=>{(null==eI?void 0:eI.principal.user.initial_order_id)&&tr?eG(!0):eV(!0)},th={"real-estate":"Files related to this property like the deed, rental agreements, insurance policies, mortgage statement, and other important information.","financial-accounts":"Files related to this financial asset like bank statements, beneficiary details, and other important information.","life-insurance":"Files related to this policy like a copy of the policy itself and other important information.",vehicle:"Files related to this vehicle like title, registration, insurance, appraisal report, or photos.",ancillary:(ej=null==e1||null==(V=e1.data)?void 0:V.estate_inventory_item_type_id,(0,O.LV)(ej)?ej===A.CR.DIRECT_BUSINESS_OWNERSHIP?"Files related to this business like partnership or operating agreements, buy-sell agreements, business valuation reports, articles of organization or incorporation, and key person insurance agreements.":"Files related to this business interest like equity-related paperwork, shareholder agreements, share certificates, and other important information.":"Files related to this asset like appraisal paperwork, a photo of the item, and other important information.")},ty=[{label:"More actions",variant:"outlined",theme:"default",leadingIcon:{iconStyle:"outlined",variant:"menu-meatball"},size:"large",id:"more-actions",dropdownItems:[{icon:(0,s.jsx)(f.I,{name:"trash",variant:"outlined"}),text:"Delete",onClick:()=>eQ(!0)},{icon:(0,s.jsx)(f.I,{name:"minus-circle",variant:"outlined"}),text:"Remove institution",onClick:()=>eF(!0)}]},{id:"edit-inventory-item",label:"Edit",variant:"filled",theme:"default",size:"large",leadingIcon:tr?{iconStyle:"outlined",variant:"lock"}:{iconStyle:"outlined",variant:"edit"},onClick:tf}],tv=[{id:"delete-inventory-item",label:"Delete",variant:"outlined",theme:"default",onClick:()=>eQ(!0),size:"large",leadingIcon:{iconStyle:"outlined",variant:"trash"}},{id:"edit-inventory-item",label:"Edit",variant:"filled",theme:"default",size:"large",leadingIcon:tr?{iconStyle:"outlined",variant:"lock"}:{iconStyle:"outlined",variant:"edit"},onClick:tf}],t_=(0,r.useMemo)(()=>{var e;return(null==e1||null==(e=e1.data)?void 0:e.plaid_institution_account)?ty:tv},[null==e1||null==(X=e1.data)||null==(H=X.plaid_institution_account)?void 0:H.plaid_account_status]);(0,r.useEffect)(()=>{e4&&eN.navigateToRoute({route:"/assets"})},[e4]);let tx=async e=>{try{let t;if(t=e?await (0,j.bE)(e):await (0,j.bE)())return ew(t),!0;return!1}catch(e){return!1}},tg=async e=>{(e?await tx(e):await tx())?eD(!0):(0,u.P0)("error",{id:"plaid-link-error",label:"Unable to relink account. Verify your credentials and try again.",action:{id:"retry-plaid-link",label:"Retry",onClick:async()=>{await tg(e)}}})},tb=(0,r.useMemo)(()=>{var e;return(0,O.Lf)(null==e1||null==(e=e1.data)?void 0:e.estate_inventory_item_type_id,e9)},[null==e1||null==(J=e1.data)?void 0:J.estate_inventory_item_type_id,e9]),tE=async e=>{eD(!1),ew(null);try{await (0,m.V)({id:"plaid-link-success-toast",loading:{label:"Loading accounts"},promise:async()=>{var t;if((null==(t=(await (0,j.bs)(e)).accounts)?void 0:t.length)>0){let e=null==e1?void 0:e1.data.id,t=await e2();await e0(),(null==t?void 0:t.status)!=="error"&&(e=>{var t,i,a;let n=null==eJ||null==(a=eJ.data)||null==(i=a.principal)||null==(t=i.assets)?void 0:t.financial_accounts;return!!(null==n?void 0:n.length)&&(null==n?void 0:n.some(t=>t.id===e))})(e)||eN.navigateToRoute({route:"/assets"})}},success:{label:"Accounts loaded",confetti:!1},error:{label:"Failed to load accounts"}})}catch(e){(0,u.P0)("error",{id:"plaid-accounts-error",label:"There was an error loading accounts data. Please try again.",duration:3e3})}},tS=(0,r.useMemo)(()=>{var e,t;return(null==e1||null==(t=e1.data)||null==(e=t.plaid_institution_account)?void 0:e.plaid_account_status)===E.i$.DELETED},[null==e1||null==(et=e1.data)||null==(ee=et.plaid_institution_account)?void 0:ee.plaid_account_status]),tj=(0,r.useMemo)(()=>e7===E.ay.RELINK||e7===E.ay.UPDATE,[e7]),tN=(0,r.useMemo)(()=>{var e,t,i;let a=null==e1||null==(e=e1.data)?void 0:e.ownership_type_id;if(a===T.A.TRUST||a===T.A.BUSINESS)return!1;if(tb)return!0;let n=null==e1||null==(t=e1.data)?void 0:t.state,s=(0,x.tu)(n);return"vehicle"===eH&&!!s||"life-insurance"===eH||"real-estate"===eH&&(0,x.B)(null==e1||null==(i=e1.data)?void 0:i.state)},[null==e1||null==(ei=e1.data)?void 0:ei.estate_inventory_item_type_id,null==e1||null==(ea=e1.data)?void 0:ea.state,null==e1||null==(en=e1.data)?void 0:en.ownership_type_id,tb,e8]),tA=async e=>{await td(e)},tT=async e=>{await tc(e)};return e5?(0,s.jsx)(L.A,{color:L.L.PERIWINKLE}):e4?(0,s.jsx)("div",{className:"py-12",children:(0,s.jsx)(W.A,{subject:"asset"})}):(0,s.jsxs)(s.Fragment,{children:[ek&&(0,s.jsx)(eu.A,{token:eR,onSuccess:tE,onExit:e=>{eD(!1),ew(null),e&&(eY({error:e})||(0,u.P0)("error",{id:"plaid-link-exit-error",label:"There was an error connecting your account. Please try again.",duration:3e3}))},onOpen:()=>eq(!1)}),eU&&(0,s.jsx)(q.A,{data:e1.data,assetType:eH,isOpen:eU,onClose:()=>
1{eq(!1),e$(0)},spouseName:(0,g.mf)(eI),principalUserName:"".concat(null==eI||null==(es=eI.principal)?void 0:es.user.user_meta.first_name," ").concat(null==eI||null==(el=eI.principal)?void 0:el.user.user_meta.last_name),isTrust:eC,trusts:to,estateInventoryItemTypes:e9}),eO&&(0,s.jsx)(P.A,{isOpen:eO,onClose:()=>eG(!1),onProceed:()=>{eG(!1),eN.navigateToRoute({route:y.Dv.MY_ACCOUNT_MEMBERSHIP,queryParams:[{key:"source",value:"assets"}]})}}),eL&&(0,s.jsx)(U.A,{modalType:"add",isOpen:eL,onClose:()=>{ez(!1)},assetToLink:{guid:eX}}),eW&&(0,s.jsx)(Y.A,{isOpen:eW,onClose:()=>{eQ(!1)},onDeleteAsset:tp,isGiftAsset:!!(null==e1?void 0:e1.data.gift_id),estateInventoryItemCategoryName:tm,assetData:null==e1?void 0:e1.data}),eP&&(0,s.jsx)(Z,{isOpen:eP,onClose:()=>{eF(!1)},onRemovePlaidInstitution:()=>{eT.invalidateQueries({queryKey:h.I.ASSETS}),eT.invalidateQueries({queryKey:h.I.ESTATE_INVENTORY_DASHBOARD_DATA}),eF(!1),eN.navigateToRoute({route:"/assets"})},plaidLinkedItemId:null==e1||null==(eo=e1.data)||null==(er=eo.plaid_institution_account)?void 0:er.plaid_linked_item_id}),eK&&(0,s.jsx)(k.AD,{children:(0,s.jsx)(B.A,{onClose:()=>{eV(!1)},trusts:to,getPlaidLinkToken:tx,dataToEdit:null==e1?void 0:e1.data})}),eM&&tN&&(0,s.jsx)(ec,{isOpen:eM,onClose:()=>eB(!1),assetData:e1,userData:null==eI||null==(ed=eI.principal)?void 0:ed.user,mutateCreateItemBeneficiaries:tA,estateInventoryItemBeneficiaries:e6,mutateEditItemBeneficiaries:tT,itemCategory:eH}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.A,{title:(()=>{if(e5)return"Inventory Item Name";if(e4)return"Inventory Item not found";if(!e5&&!e4)switch(eH){case"real-estate":return"".concat(e1.data.address_line_one);case"financial-accounts":if(e1.data.nickname)return e1.data.nickname;return e1.data.name;case"vehicle":return"".concat(e1.data.year," ").concat(e1.data.make," ").concat(e1.data.model);case"life-insurance":if(e1.data.policy_name)return e1.data.policy_name;return e1.data.name;default:return e1.data.name}return"Inventory Item Name"})(),backLink:!0,backLinkText:"Back",buttons:t_}),tS&&(0,s.jsx)(p.Y,{id:"inactive-plaid-account",variant:"warning",title:"This account has been closed",message:"We detected that ".concat(null==e1||null==(em=e1.data)?void 0:em.nickname," has been closed at your bank. You can delete the account to remove it from your estate inventory."),actions:[{id:"delete-account",label:"Delete account",onClick:()=>eQ(!0)}],className:"mb-6"}),tj&&!tS&&(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(p.Y,{id:"new-plaid-account-available",variant:"warning",title:"Account unlinked",message:"Your account is no longer linked. Relink it to keep your information current.",actions:[{id:"plaid-relink-account",label:"Relink account",onClick:()=>{if(e7===E.ay.RELINK)tg();else if(e7===E.ay.UPDATE){var e;tg(null==e1||null==(e=e1.data)?void 0:e.id)}}}]})}),(0,s.jsx)(eE.default,{isAssetError:e4,isAssetLoading:e5,assetType:eH,assetData:e1,user_meta:null==eI||null==(ef=eI.principal)||null==(ep=ef.user)?void 0:ep.user_meta,hasSpouse:null==eI||null==(ey=eI.principal)||null==(eh=ey.user)?void 0:eh.has_spouse,spouseName:(0,g.mf)(eI),isTrust:eC,trusts:to,queryClient:eT}),tN&&(0,s.jsx)($,{setIsBeneficiaryModalOpen:eB,beneficiaries:e6,deleteAllBeneficiaries:tu,itemCategory:eH}),!e5&&!e4&&(0,s.jsx)(F.A,{title:"Linked files",ctaButton:!0,ctaText:"Add",ctaVariant:"outlined",cardEmptyProps:(null==tt?void 0:tt.length)===0&&{title:"Start by linking your first file",text:(0,s.jsx)("div",{className:"max-w-md",children:th["".concat(eH)]})},ctaIcon:!tr&&(null==eI||null==(e_=eI.principal)||null==(ev=e_.user)?void 0:ev.initial_order_id)?{iconStyle:"outlined",variant:"plus"}:{iconStyle:"outlined",variant:"lock"},ctaAction:()=>{var e,t;(null==eI||null==(t=eI.principal)||null==(e=t.user)?void 0:e.initial_order_id)?tr?eG(!0):ez(!0):eN.navigateToRoute({route:y.Dv.FLOW_CHECKOUT_CART})},children:(null==tt?void 0:tt.length)>0&&(0,s.jsx)(eb,{otherDocumentsTableData:tt,srOnlyCaption:"This table lists files linked to the selected inventory item, identified by file name."})}),(null==e1||null==(ex=e1.data)?void 0:ex.is_zestimate)&&(0,s.jsx)("div",{className:"mt-6 text-left",children:(0,s.jsxs)("p",{className:"!text-muted-foreground text-sm",children:["\xa9 Zillow, Inc., 2006-",new Date().getFullYear(),". Use is subject to the Zillow"," ",(0,s.jsx)("a",{href:"https://www.zillow.com/z/corp/terms/",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-primary-emphasis underline [text-decoration-skip-ink:none]",children:"Terms of Use"}),"."]})})]})]})}eS.getLayout=function(e){return(0,s.jsx)(D.A,{children:e})},eS.pageTitle="Asset Details"},40050:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var a=i(37876),n=i(42493),s=i(78790);function l(e){let{align:t="left",displayAt:i,width:l,screenReaderOnly:r,children:o}=e;return(0,a.jsx)("th",{scope:"col",className:"px-6 py-3 min-w-max whitespace-nowrap\n ".concat(s.m_[t],"\n ").concat(r?"sr-only":i?"hidden ".concat(s.UD[i]):"table-cell","\n ").concat(l||"","\n "),children:(0,a.jsx)(n.o,{className:"!text-foreground-secondary",variant:"title-xs",children:o})})}},50492:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var a=i(37876),n=i(58176),s=i(65384);function l(e){let{children:t,dataTestId:i="table-wrapper",tableClassName:l,useRowDividers:r=!1}=e;return(0,a.jsx)("div",{className:"overflow-x-auto sm:border border-hairline sm:rounded-lg","data-testid":i,children:(0,a.jsx)(n.XI,{bare:!0,className:(0,s.A)("min-w-full",r?"[&>tbody>tr+tr]:border-t [&>tbody>tr+tr]:border-hairline":"sm:divide-y sm:divide-hairline",l),children:t})})}},51742:(e,t,i)=>{"use strict";i.d(t,{A:()=>
1o});var a=i(46045),n=i(37876),s=i(84552),l=i(95862),r=i(21401);function o(e){let{isOpen:t,onClose:i,onConfirmAction:o,confirmButtonText:d,title:c,description:u,children:m,subTitle:p,cancelButtonText:f="Cancel",confirmButtonTheme:h="destructive",isStatic:y,isLoading:v}=e,_=(0,a._)({title:c,description:u},p&&{subTitle:p});return t&&(0,n.jsxs)(r.A,{isOpen:t,data:_,settings:{role:"confirm_action",maxWidth:512,minWidth:260,disableClose:!1},onClose:i,hasChildForm:!0,isStatic:y,children:[m,(0,n.jsx)(s.A,{isInModalBody:!0,children:(0,n.jsxs)("div",{className:"space-x-3 flex",children:[(0,n.jsx)(l.$,{type:"button",id:"cancel","data-testid":"cancel",variant:"outline",size:"lg",onClick:i,children:f}),(0,n.jsx)(l.$,{id:"confirm-action-".concat(h),"data-testid":"confirm-action-".concat(h),type:"submit",variant:"primary",size:"lg",onClick:o,loading:v,children:d})]})})]})}},52495:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var a=i(37876),n=i(78790);function s(e){let{align:t="left",smallPadding:i=!1,verticalAlign:s="middle",displayAt:l,width:r,children:o}=e;return(0,a.jsx)("td",{className:"px-3 sm:px-6 ".concat(i?"py-4":"py-8","\n ").concat(n.m_[t],"\n ").concat(n.pq[s],"\n ").concat(r||"","\n ").concat(l?"hidden ".concat(n.UD[l]):"table-cell","\n "),children:o})}},65384:(e,t,i)=>{"use strict";i.d(t,{A:()=>function e(){for(var t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];let n="",s=e=>{n?n+=" ".concat(e):n=e};return i.forEach(t=>{if(!t)return;let i=typeof t;if("string"===i||"number"===i)return void s(String(t));if(Array.isArray(t)){if(t.length>0){let i=e(...t);i&&s(i)}return}if("object"===i)for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&t[e]&&s(e)}),n}})},71550:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var a=i(37876),n=i(42493),s=i(97891);function l(e){let{title:t,titleAs:i,titleRowClickEvent:l=null,rows:r,isSingleColumn:o,textSize:d="body-sm",icon:c={className:"!text-primary-emphasis",variant:"check-circle"}}=e;return r&&0!==r.length?(0,a.jsxs)(a.Fragment,{children:[t&&(0,a.jsxs)("div",{className:"mb-2 mt-4 ".concat(l?"flex flex-row justify-between":""),children:[(0,a.jsx)(n.o,{className:"self-center",as:i||"div",variant:"body-md-bold",children:t}),l&&(0,a.jsx)(n.o,{as:"button",type:"button",onClick:l.clickHandler,className:"pointer p-0 min-h-0 min-w-0",variant:"body-md-bold",children:null==l?void 0:l.text})]}),(0,a.jsx)("ul",{className:o?"flex flex-col":"md:grid md:grid-cols-2",children:r.map((e,t)=>{var i;return(0,a.jsxs)("li",{className:"flex flex-row justify-start items-center py-1",children:[(0,a.jsx)(s.I,{className:null!=(i=c.className)?i:"!text-primary-emphasis",name:c.variant,variant:"outlined",size:"sm"}),(0,a.jsx)(n.o,{as:"div",className:"ml-2",variant:d,children:e})]},"".concat(e).concat(t+1))})})]}):null}},72458:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});var a=i(37876);function n(e){let{children:t}=e;return(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{className:"bg-muted w-full hidden sm:table-row",children:t})})}},78790:(e,t,i)=>{"use strict";i.d(t,{UD:()=>a,m_:()=>n,pq:()=>s});let a={xs:"xs:table-cell",sm:"sm:table-cell",md:"md:table-cell",lg:"lg:table-cell",xl:"xl:table-cell","2xl":"2xl:table-cell"},n={left:"text-left",center:"text-center",right:"text-right"},s={top:"align-top",middle:"align-middle",bottom:"align-bottom"}},89120:(e,t,i)=>{"use strict";i.d(t,{A:()=>d});var a=i(37876),n=i(84552),s=i(42493),l=i(71550),r=i(95862),o=i(21401);function d(e){let{isOpen:t,onClose:i,onProceed:d,minWidth:c=480}=e,u={title:"Upgrade your membership to get access to this feature",subTitle:"Membership",description:"Our memberships give you the tools and resources to update your plan as your family, finances, and future evolveâso you can always feel confident that your loved ones are protected, no matter what life brings.",includesHeading:"Our paid memberships include access to:",options:[{heading:"AI assistant",label:"âGet quick answers from an AI-powered estate planning expert"},{heading:"Free shipping",label:"âReceive your estate plan documents at no extra cost ($45 savings)"},{heading:"Digital Safe",label:"âSecurely store and organize important personal files"}]},m=()=>{i()};return t&&(0,a.jsxs)(o.A,{isOpen:t,data:u,settings:{role:"discard_changes",maxWidth:512,minWidth:c,disableClose:!1},onClose:m,hasChildForm:!0,children:[(0,a.jsxs)("div",{id:"modal-membership-redirect-content",children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(s.o,{variant:"body-md",as:"p",className:"mb-6 mt-4",children:u.description})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(s.o,{variant:"body-md",as:"p",className:"mb-6 mt-4",children:u.includesHeading})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(l.A,{rows:u.options.map(e=>(0,a.jsx)("div",{children:(0,a.jsxs)(s.o,{variant:"body-md",as:"p",children:[(0,a.jsx)("span",{className:"font-bold",children:e.heading}),e.label]})},e.heading)),isSingleColumn:!0})})]}),(0,a.jsx)(n.A,{isInModalBody:!0,children:(0,a.jsxs)("div",{className:"space-x-3 flex",children:[(0,a.jsx)(r.$,{type:"button",id:"cancel","data-testid":"cancel",variant:"outline",size:"lg",onClick:()=>m(),children:"Cancel"}),(0,a.jsx)(r.$,{id:"proceed","data-testid":"proceed",type:"submit",variant:"primary",size:"lg",onClick:d,children:"View options"})]})})]})}},98396:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/assets/[assetType]/[guid]",function(){return i(17514)}])},98753:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});var a=i(37876);function n(e){let{clickAction:t=null,handleSetHoverState:i,className:n,children:s}=e;return(0,a.jsx)("tr",{className:"\n ".concat(!!t&&"\n focus-within:outline focus-within:outline-2 focus-within:outline-primary\n hover:bg-primary-faint active:bg-primary-light active:outline-none\n","\n ").concat(t?"cursor-pointer":"cursor-default","\n ").concat(null!=n?n:"","\n "),onClick:t?()=>{t()}:null,onMouseEnter:i?()=>i(!0):null,onMouseLeave:i?()=>i(!1):null,children:s})}}},e=>{e.O(0,[980,5352,6361,6430,1047,1301,8742,5560,6611,9650,7745,1103,1481,5675,4777,5660,7190,2005,267,5114,3102,3931,6219,9346,9463,123,8513,6104,8922,9090,636,6593,1919,8792],()=>e(e.s=98396)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.