PageSourceSearch

https://app.aasaanwill.com/_app/immutable/nodes/37.DIHzG0h-.js

js aasaanwill.com collected 2026-10-07 01:11:49 UTC 164,003 bytes, 9 lines download raw bytes

1import{c as br,m as Re,i as ci,j as ti,l as Ki,k as gi,n as Qt,w as en,o as yi,x as tn,s as At,p as qi,q as Vn,y as hr,r as Qi,t as mr}from"../chunks/ioc.DJuwJiaz.js";import{i as gr,g as Zt,a as Et,c as Ht,l as ei,b as He,w as yr,e as ui,r as vi}from"../chunks/will.CIEFmBbB.js";import{e as ii}from"../chunks/executor.CZeuKjcR.js";import{_ as vr}from"../chunks/preload-helper.BQ24v_F8.js";import{s as le,e as P,a as V,c as D,b as B,f as g,g as T,l as te,o as I,W as wr,i as S,h as v,q as ge,x as Je,E as di,k as U,F as ni,u as H,t as pe,d as be,j as Be,n as Me,w as j,y as J,m as qe,p as nr,z as $i,G as sr,r as rr,I as lr,J as ar,K as or,Y as $r,D as Ir}from"../chunks/scheduler.BUO0MXo3.js";import{S as ae,i as oe,c as x,a as F,m as C,g as q,d as $,b as Y,t as w,e as A,j as Ii,k as ki,f as O,h as Yi}from"../chunks/index.C2KUhGDG.js";import{a as mi,E as kr,b as Pr,c as Dr,P as Br,w as Sr,g as Er,W as xr,A as Cr,d as Ar,L as Lr,e as Vr}from"../chunks/Preview.B2M15ce6.js";import{e as ie,u as We,d as si,o as Lt}from"../chunks/each.DvKsEuuv.js";import{I as Le}from"../chunks/Icon.CbVpWBTV.js";import{B as ht}from"../chunks/Button.6rXMLJe7.js";import{g as ri}from"../chunks/entry.DE0dRkpw.js";import{s as wt,f as Ui}from"../chunks/index.BAvrQ_cS.js";import{k as Tr,C as Fr,D as Nr,h as Hr,L as Mr,A as fr,F as Wr,n as fn,o as Xi,p as Zi,P as cn,E as un,J as jr,e as Gi,t as cr,S as ur,I as Or,B as dr,d as dn,H as zr,K as Rr,M as Jr,N as qr}from"../chunks/PercentageDistributionCard.D7v3V8xG.js";import{c as xt}from"../chunks/customer_detail._8NznOBp.js";import{b as ce}from"../chunks/button.BHig0c-q.js";import{A as mt}from"../chunks/index.C-ZYPcG6.js";import{p as Ze}from"../chunks/stores.2qpv0iz0.js";import{E as Yr,a as _r}from"../chunks/ExecutorListCard.BhrDJwxb.js";const Ur=async({params:r})=>{try{const e=r.id;if(!e)throw new Error("no will found");await br.willService().progress(e),ii.resetStore(),await ii.fetchExecutors(e),await gr(e)}catch(e){console.error(e)}},If=Object.freeze(Object.defineProperty({__proto__:null,load:Ur},Symbol.toStringTag,{value:"Module"})),Pi=r=>{r.delete("step"),r.delete("personal-details-step"),r.delete("assets-liabilities-step"),r.delete("assets-liabilities-id"),r.delete("assets-liabilities-type"),r.delete("beneficiaries-step"),r.delete("beneficiaries-id"),r.delete("asset-distribution-step"),r.delete("executors-step"),r.delete("executor-id")},hi=(r,e)=>{const i=new URLSearchParams(window.location.search);Pi(i),i.set("step",r),i.set(`${r}-step`,e),ri(`?${i.toString()}`)},pr=r=>{const e=new URLSearchParams(window.location.search);Pi(e),e.set("step","personal-details"),e.set("personal-details-step",r),ri(`?${e.toString()}`)},$t=(r,e=null,i=null)=>{const t=new URLSearchParams(window.location.search);Pi(t),t.set("step","assets-liabilities"),t.set("assets-liabilities-step",r),e?t.set("assets-liabilities-type",e):t.delete("assets-liabilities-type"),i?t.set("assets-liabilities-id",i):t.delete("assets-liabilities-id"),ri(`?${t.toString()}`)},Fe=(r,e=null)=>{const i=new URLSearchParams(window.location.search);Pi(i),i.set("step","beneficiaries"),i.set("beneficiaries-step",r),e?i.set("beneficiaries-id",e):i.delete("beneficiaries-id"),ri(`?${i.toString()}`)},Ct=(r,e=null,i=!1)=>{const t=new URLSearchParams(window.location.search);Pi(t),t.set("step","asset-distribution"),t.set("asset-distribution-step",r),e?t.set("asset-id",e):t.delete("asset-id"),i?t.set("is-editing","true"):t.delete("is-editing"),ri(`?${t.toString()}`)},wi=(r,e=null)=>{const i=new URLSearchParams(window.location.search);Pi(i),i.set("step","executors"),i.set("executors-step",r),e?i.set("executor-id",e):i.delete("executors-id"),ri(`?${i.toString()}`)};function Tn(r,e,i){const t=r.slice();return t[41]=e[i],t[43]=i,t}function Fn(r,e,i){const t=r.slice();return t[41]=e[i],t[43]=i,t}function Nn(r,e,i){const t=r.slice();return t[41]=e[i],t[43]=i,t}function Hn(r,e,i){const t=r.slice();return t[46]=e[i],t}function Mn(r,e,i){const t=r.slice();return t[49]=e[i],t[43]=i,t}function Wn(r,e,i){const t=r.slice();return t[51]=e[i],t}function jn(r,e,i){const t=r.slice();return t[54]=e[i],t[43]=i,t}
1function Gr(r){let e,i='<span class="text-base font-semibold text-white leading-6">1</span>';return{c(){e=P("div"),e.innerHTML=i,this.h()},l(t){e=D(t,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-lzi9fc"&&(e.innerHTML=i),this.h()},h(){I(e,"class","rounded-full h-7 w-7 bg-aasaan_logo_blue text-center")},m(t,n){S(t,e,n)},i:Me,o:Me,d(t){t&&g(e)}}}function Kr(r){let e,i;return e=new Le({props:{kind:"will_step_complete"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Qr(r){let e,i;return e=new Le({props:{kind:"current_will_step"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Xr(r){let e,i='<span class="text-base font-semibold text-white leading-6">2</span>';return{c(){e=P("div"),e.innerHTML=i,this.h()},l(t){e=D(t,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-4i5h39"&&(e.innerHTML=i),this.h()},h(){I(e,"class","rounded-full h-7 w-7 bg-aasaan_logo_blue text-center")},m(t,n){S(t,e,n)},i:Me,o:Me,d(t){t&&g(e)}}}function Zr(r){let e,i;return e=new Le({props:{kind:"will_step_complete"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function el(r){let e,i;return e=new Le({props:{kind:"current_will_step"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function On(r){let e,i,t,n="Assets",l,s,o,a,f,c,u,m;o=new Le({props:{kind:"expand"}});let p=r[1]&&zn(r);return{c(){e=P("div"),i=P("div"),t=P("span"),t.textContent=n,l=V(),s=P("div"),x(o.$$.fragment),f=V(),p&&p.c(),this.h()},l(_){e=D(_,"DIV",{class:!0});var d=B(e);i=D(d,"DIV",{class:!0});var b=B(i);t=D(b,"SPAN",{class:!0,"data-svelte-h":!0}),te(t)!=="svelte-psguan"&&(t.textContent=n),l=T(b),s=D(b,"DIV",{class:!0});var y=B(s);F(o.$$.fragment,y),y.forEach(g),b.forEach(g),f=T(d),p&&p.l(d),d.forEach(g),this.h()},h(){I(t,"class","text-base text-drak_grey_text font-semibold leading-6 cursor-pointer"),I(s,"class",a="cursor-pointer "+(r[1]?"rotate-180":"")),I(i,"class","inline-flex gap-x-1 items-center"),I(e,"class","flex flex-col pl-[58px]")},m(_,d){S(_,e,d),v(e,i),v(i,t),v(i,l),v(i,s),C(o,s,null),v(e,f),p&&p.m(e,null),c=!0,u||(m=[ge(t,"click",Je(r[20])),ge(s,"click",r[21])],u=!0)},p(_,d){(!c||d[0]&2&&a!==(a="cursor-pointer "+(_[1]?"rotate-180":"")))&&I(s,"class",a),_[1]?p?(p.p(_,d),d[0]&2&&w(p,1)):(p=zn(_),p.c(),w(p,1),p.m(e,null)):p&&(q(),$(p,1,1,()=>{p=null}),Y())},i(_){c||(w(o.$$.fragment,_),w(p),c=!0)},o(_){$(o.$$.fragment,_),$(p),c=!1},d(_){_&&g(e),A(o),p&&p.d(),u=!1,di(m)}}}function zn(r){let e,i=[],t=new Map,n,l,s,o=ie(ci);const a=f=>f[51];for(let f=0;f<o.length;f+=1){let c=Wn(r,o,f),u=a(c);t.set(u,i[f]=qn(u,c))}return{c(){e=P("div");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=D(f,"DIV",{class:!0});var c=B(e);for(let u=0;u<i.length;u+=1)i[u].l(c);c.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-6 pt-6")},m(f,c){S(f,e,c);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);s=!0},p(f,c){c[0]&192&&(o=ie(ci),i=We(i,c,a,1,f,o,t,e,si,qn,null,Wn))},i(f){s||(f&&ni(()=>{s&&(l&&l.end(1),n=Ii(e,wt,{}),n.start())}),s=!0)},o(f){n&&n.invalidate(),f&&(l=ki(e,wt,{})),s=!1},d(f){f&&g(e);for(let c=0;c<i.length;c+=1)i[c].d();f&&l&&l.end()}}}function Rn(r){let e=[],i=new Map,t,n=ie(Qt(r[51],r[6]));const l=s=>s[54].id;for(let s=0;s<n.length;s+=1){let o=jn(r,n,s),a=l(o);i.set(a,e[s]=Jn(a,o))}return{c(){for(let s=0;s<e.length;s+=1)e[s].c();t=H()},l(s){for(let o=0;o<e.length;o+=1)e[o].l(s);t=H()},m(s,o){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(s,o);S(s,t,o)},p(s,o){o[0]&64&&(n=ie(Qt(s[51],s[6])),e=We(e,o,l,1,s,n,i,t.parentNode,si,Jn,t,jn))},d(s){s&&g(t);for(let o=0;o<e.length;o+=1)e[o].d(s)}}}function Jn(r,e){let i,t=en.find(u).assetIdentifier.replace(/-/g," ")+"",n,l,s=e[43]+1+"",o,a,f,c;function u(...p){return e[22](e[51],...p)}function m(){return e[23](e[51],e[54])}return{key:r,first:null,c(){i=P("span"),n=pe(t),l=V(),o=pe(s),a=V(),this.h()},l(p){i=D(p,"SPAN",{class:!0});var _=B(i);n=be(_,t),l=T(_),o=be(_,s),a=T(_),_.forEach(g),this.h()},h(){I(i,"class","text-sm font-medium text-dark_grey_text leading-6 px-3 capitalize cursor-pointer"),this.first=i},m(p,_){S(p,i,_),v(i,n),v(i,l),v(i,o),v(i,a),f||(c=ge(i,"click",Je(m)),f=!0)},p(p,_){e=p,_[0]&64&&s!==(s=e[43]+1+"")&&Be(o,s)},d(p){p&&g(i),f=!1,c()}}}function qn(r,e){var l,s;let i,t,n=((l=e[7])==null?void 0:l.selected_asset_types)&&((s=e[7])==null?void 0:s.selected_asset_types[ti[e[51]]])&&Rn(e);return{key:r,first:null,c(){i=H(),n&&n.c(),t=H(),this.h()},l(o){i=H(),n&&n.l(o),t=H(),this.h()},h(){this.first=i},m(o,a){S(o,i,a),n&&n.m(o,a),S(o,t,a)},p(o,a){var f,c;e=o,(f=e[7])!=null&&f.selected_asset_types&&((c=e[7])!=null&&c.selected_asset_types[ti[e[51]]])?n?n.p(e,a):(n=Rn(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(o){o&&(g(i),g(t)),n&&n.d(o)}}}function Yn(r){let e,i,t,n="Liabilities",l,s,o,a,f,c,u,m;o=new Le({props:{kind:"expand"}});let p=r[5]&&Un(r);return{c(){e=P("div"),i=P("div"),t=P("span"),t.textContent=n,l=V(),s=P("div"),x(o.$$.fragment),f=V(),p&&p.c(),this.h()},l(_){e=D(_,"DIV",{class:!0});var d=B(e);i=D(d,"DIV",{class:!0});var b=B(i);t=D(b,"SPAN",{class:!0,"data-svelte-h":!0}),te(t)!=="svelte-23zm6d"&&(t.textContent=n),l=T(b),s=D(b,"DIV",{class:!0});var y=B(s);
1F(o.$$.fragment,y),y.forEach(g),b.forEach(g),f=T(d),p&&p.l(d),d.forEach(g),this.h()},h(){I(t,"class","text-base text-drak_grey_text font-semibold leading-6 cursor-pointer"),I(s,"class",a="cursor-pointer "+(r[5]?"rotate-180":"")),I(i,"class","inline-flex gap-x-1 items-center"),I(e,"class","flex flex-col pl-[58px]")},m(_,d){S(_,e,d),v(e,i),v(i,t),v(i,l),v(i,s),C(o,s,null),v(e,f),p&&p.m(e,null),c=!0,u||(m=[ge(t,"click",Je(r[24])),ge(s,"click",r[25])],u=!0)},p(_,d){(!c||d[0]&32&&a!==(a="cursor-pointer "+(_[5]?"rotate-180":"")))&&I(s,"class",a),_[5]?p?(p.p(_,d),d[0]&32&&w(p,1)):(p=Un(_),p.c(),w(p,1),p.m(e,null)):p&&(q(),$(p,1,1,()=>{p=null}),Y())},i(_){c||(w(o.$$.fragment,_),w(p),c=!0)},o(_){$(o.$$.fragment,_),$(p),c=!1},d(_){_&&g(e),A(o),p&&p.d(),u=!1,di(m)}}}function Un(r){let e,i=[],t=new Map,n,l,s,o=ie(Ki);const a=f=>f[46];for(let f=0;f<o.length;f+=1){let c=Hn(r,o,f),u=a(c);t.set(u,i[f]=Qn(u,c))}return{c(){e=P("div");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=D(f,"DIV",{class:!0});var c=B(e);for(let u=0;u<i.length;u+=1)i[u].l(c);c.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-6 pt-6")},m(f,c){S(f,e,c);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);s=!0},p(f,c){c[0]&384&&(o=ie(Ki),i=We(i,c,a,1,f,o,t,e,si,Qn,null,Hn))},i(f){s||(f&&ni(()=>{s&&(l&&l.end(1),n=Ii(e,wt,{}),n.start())}),s=!0)},o(f){n&&n.invalidate(),f&&(l=ki(e,wt,{})),s=!1},d(f){f&&g(e);for(let c=0;c<i.length;c+=1)i[c].d();f&&l&&l.end()}}}function Gn(r){let e=[],i=new Map,t,n=ie(yi(r[46],r[8]));const l=s=>s[49].id;for(let s=0;s<n.length;s+=1){let o=Mn(r,n,s),a=l(o);i.set(a,e[s]=Kn(a,o))}return{c(){for(let s=0;s<e.length;s+=1)e[s].c();t=H()},l(s){for(let o=0;o<e.length;o+=1)e[o].l(s);t=H()},m(s,o){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(s,o);S(s,t,o)},p(s,o){o[0]&256&&(n=ie(yi(s[46],s[8])),e=We(e,o,l,1,s,n,i,t.parentNode,si,Kn,t,Mn))},d(s){s&&g(t);for(let o=0;o<e.length;o+=1)e[o].d(s)}}}function Kn(r,e){var p;let i,t=((p=tn.find(u))==null?void 0:p.liabilityIdentifier.replace(/-/g," "))+"",n,l,s=e[43]+1+"",o,a,f,c;function u(..._){return e[26](e[46],..._)}function m(){return e[27](e[46],e[49])}return{key:r,first:null,c(){i=P("span"),n=pe(t),l=V(),o=pe(s),a=V(),this.h()},l(_){i=D(_,"SPAN",{class:!0});var d=B(i);n=be(d,t),l=T(d),o=be(d,s),a=T(d),d.forEach(g),this.h()},h(){I(i,"class","text-sm font-medium text-dark_grey_text leading-6 px-3 capitalize cursor-pointer"),this.first=i},m(_,d){S(_,i,d),v(i,n),v(i,l),v(i,o),v(i,a),f||(c=ge(i,"click",Je(m)),f=!0)},p(_,d){e=_,d[0]&256&&s!==(s=e[43]+1+"")&&Be(o,s)},d(_){_&&g(i),f=!1,c()}}}function Qn(r,e){var l,s;let i,t,n=((l=e[7])==null?void 0:l.selected_liability_types)&&((s=e[7])==null?void 0:s.selected_liability_types[gi[e[46]]])&&Gn(e);return{key:r,first:null,c(){i=H(),n&&n.c(),t=H(),this.h()},l(o){i=H(),n&&n.l(o),t=H(),this.h()},h(){this.first=i},m(o,a){S(o,i,a),n&&n.m(o,a),S(o,t,a)},p(o,a){var f,c;e=o,(f=e[7])!=null&&f.selected_liability_types&&((c=e[7])!=null&&c.selected_liability_types[gi[e[46]]])?n?n.p(e,a):(n=Gn(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(o){o&&(g(i),g(t)),n&&n.d(o)}}}function tl(r){let e,i='<span class="text-base font-semibold text-white leading-6">3</span>';return{c(){e=P("div"),e.innerHTML=i,this.h()},l(t){e=D(t,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-4497wm"&&(e.innerHTML=i),this.h()},h(){I(e,"class","rounded-full h-7 w-7 bg-aasaan_logo_blue text-center")},m(t,n){S(t,e,n)},i:Me,o:Me,d(t){t&&g(e)}}}function il(r){let e,i;return e=new Le({props:{kind:"will_step_complete"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function nl(r){let e,i;return e=new Le({props:{kind:"current_will_step"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Xn(r){let e,i,t,n="People & Charities",l,s,o,a,f,c,u,m;o=new Le({props:{kind:"expand"}});let p=r[2]&&Zn(r);return{c(){e=P("div"),i=P("div"),t=P("span"),t.textContent=n,l=V(),s=P("div"),x(o.$$.fragment),f=V(),p&&p.c(),this.h()},l(_){e=D(_,"DIV",{class:!0});var d=B(e);i=D(d,"DIV",{class:!0});var b=B(i);t=D(b,"SPAN",{class:!0,"data-svelte-h":!0}),te(t)!=="svelte-15ijj4a"&&(t.textContent=n),l=T(b),s=D(b,"DIV",{class:!0});var y=B(s);
1F(o.$$.fragment,y),y.forEach(g),b.forEach(g),f=T(d),p&&p.l(d),d.forEach(g),this.h()},h(){I(t,"class","text-base text-drak_grey_text font-semibold leading-6 cursor-pointer"),I(s,"class",a="cursor-pointer "+(r[2]?"rotate-180":"")),I(i,"class","inline-flex gap-x-1 items-center"),I(e,"class","flex flex-col pl-[58px]")},m(_,d){S(_,e,d),v(e,i),v(i,t),v(i,l),v(i,s),C(o,s,null),v(e,f),p&&p.m(e,null),c=!0,u||(m=[ge(t,"click",Je(r[29])),ge(s,"click",r[30])],u=!0)},p(_,d){(!c||d[0]&4&&a!==(a="cursor-pointer "+(_[2]?"rotate-180":"")))&&I(s,"class",a),_[2]?p?(p.p(_,d),d[0]&4&&w(p,1)):(p=Zn(_),p.c(),w(p,1),p.m(e,null)):p&&(q(),$(p,1,1,()=>{p=null}),Y())},i(_){c||(w(o.$$.fragment,_),w(p),c=!0)},o(_){$(o.$$.fragment,_),$(p),c=!1},d(_){_&&g(e),A(o),p&&p.d(),u=!1,di(m)}}}function Zn(r){let e,i=[],t=new Map,n,l,s,o=ie(Re(["Beneficiary::Person","Beneficiary::Charity"],r[9]));const a=f=>f[41].id;for(let f=0;f<o.length;f+=1){let c=Nn(r,o,f),u=a(c);t.set(u,i[f]=es(u,c))}return{c(){e=P("div");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=D(f,"DIV",{class:!0});var c=B(e);for(let u=0;u<i.length;u+=1)i[u].l(c);c.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-6 pt-6")},m(f,c){S(f,e,c);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);s=!0},p(f,c){c[0]&512&&(o=ie(Re(["Beneficiary::Person","Beneficiary::Charity"],f[9])),i=We(i,c,a,1,f,o,t,e,si,es,null,Nn))},i(f){s||(f&&ni(()=>{s&&(l&&l.end(1),n=Ii(e,wt,{}),n.start())}),s=!0)},o(f){n&&n.invalidate(),f&&(l=ki(e,wt,{})),s=!1},d(f){f&&g(e);for(let c=0;c<i.length;c+=1)i[c].d();f&&l&&l.end()}}}function es(r,e){let i,t,n=e[43]+1+"",l,s,o,a;function f(){return e[31](e[41])}return{key:r,first:null,c(){i=P("span"),t=pe("Beneficiary "),l=pe(n),s=V(),this.h()},l(c){i=D(c,"SPAN",{class:!0});var u=B(i);t=be(u,"Beneficiary "),l=be(u,n),s=T(u),u.forEach(g),this.h()},h(){I(i,"class","text-sm font-medium text-dark_grey_text leading-6 px-3 capitalize cursor-pointer"),this.first=i},m(c,u){S(c,i,u),v(i,t),v(i,l),v(i,s),o||(a=ge(i,"click",Je(f)),o=!0)},p(c,u){e=c,u[0]&512&&n!==(n=e[43]+1+"")&&Be(l,n)},d(c){c&&g(i),o=!1,a()}}}function ts(r){let e,i,t,n="Pets",l,s,o,a,f,c,u,m;o=new Le({props:{kind:"expand"}});let p=r[3]&&is(r);return{c(){e=P("div"),i=P("div"),t=P("span"),t.textContent=n,l=V(),s=P("div"),x(o.$$.fragment),f=V(),p&&p.c(),this.h()},l(_){e=D(_,"DIV",{class:!0});var d=B(e);i=D(d,"DIV",{class:!0});var b=B(i);t=D(b,"SPAN",{class:!0,"data-svelte-h":!0}),te(t)!=="svelte-11bd2er"&&(t.textContent=n),l=T(b),s=D(b,"DIV",{class:!0});var y=B(s);F(o.$$.fragment,y),y.forEach(g),b.forEach(g),f=T(d),p&&p.l(d),d.forEach(g),this.h()},h(){I(t,"class","text-base text-drak_grey_text font-semibold leading-6 cursor-pointer"),I(s,"class",a="cursor-pointer "+(r[3]?"rotate-180":"")),I(i,"class","inline-flex gap-x-1 items-center"),I(e,"class","flex flex-col pl-[58px]")},m(_,d){S(_,e,d),v(e,i),v(i,t),v(i,l),v(i,s),C(o,s,null),v(e,f),p&&p.m(e,null),c=!0,u||(m=[ge(t,"click",Je(r[32])),ge(s,"click",r[33])],u=!0)},p(_,d){(!c||d[0]&8&&a!==(a="cursor-pointer "+(_[3]?"rotate-180":"")))&&I(s,"class",a),_[3]?p?(p.p(_,d),d[0]&8&&w(p,1)):(p=is(_),p.c(),w(p,1),p.m(e,null)):p&&(q(),$(p,1,1,()=>{p=null}),Y())},i(_){c||(w(o.$$.fragment,_),w(p),c=!0)},o(_){$(o.$$.fragment,_),$(p),c=!1},d(_){_&&g(e),A(o),p&&p.d(),u=!1,di(m)}}}function is(r){let e,i=[],t=new Map,n,l,s,o=ie(Re(["Beneficiary::Pet"],r[9]));const a=f=>f[41].id;for(let f=0;f<o.length;f+=1){let c=Fn(r,o,f),u=a(c);t.set(u,i[f]=ns(u,c))}return{c(){e=P("div");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=D(f,"DIV",{class:!0});var c=B(e);for(let u=0;u<i.length;u+=1)i[u].l(c);c.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-6 pt-6")},m(f,c){S(f,e,c);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);s=!0},p(f,c){c[0]&512&&(o=ie(Re(["Beneficiary::Pet"],f[9])),i=We(i,c,a,1,f,o,t,e,si,ns,null,Fn))},i(f){s||(f&&ni(()=>{s&&(l&&l.end(1),n=Ii(e,wt,{}),n.start())}),s=!0)},o(f){n&&n.invalidate(),f&&(l=ki(e,wt,{})),s=!1},d(f){f&&g(e);for(let c=0;c<i.length;c+=1)i[c].d();f&&l&&l.end()}}}function ns(r,e){let i,t,n=e[43]+1+"",l,s,o,a;function f(){return e[34](e[41])}return{key:r,first:null,c(){i=P("span"),t=pe("Pet "),l=pe(n),s=V(),this.h()},l(c){i=D(c,"SPAN",{class:!0});var u=B(i);t=be(u,"Pet "),l=be(u,n),s=T(u),u.forEach(g),this.h()},h(){I(i,"class","text-sm font-medium text-dark_grey_text leading-6 px-3 capitalize cursor-pointer"),this.first=i},m(c,u){S(c,i,u),v(i,t),v(i,l),v(i,s),o||(a=ge(i,"click",Je(f)),o=!0)},p(c,u){e=c,u[0]&512&&n!==(n=e[43]+1+"")&&Be(l,n)},d(c){c&&g(i),o=!1,a()}}}function ss(r){let e,i,t,n="Excluded Persons",l,s,o,a,f,c,u,m;o=new Le({props:{kind:"expand"}});let p=r[4]&&rs(r);return{c(){e=P("div"),i=P("div"),t=P("span"),t.textContent=n,l=V(),s=P("div"),x(o.$$.fragment),f=V(),p&&p.c(),this.h()},l(_){e=D(_,"DIV",{class:!0});var d=B(e);i=D(d,"DIV",{class:!0});var b=B(i);t=D(b,"SPAN",{class:!0,"data-svelte-h":!0}),te(t)!=="svelte-1ckqnar"&&(t.textContent=n),l=T(b),s=D(b,"DIV",{class:!0});var y=B(s);
1F(o.$$.fragment,y),y.forEach(g),b.forEach(g),f=T(d),p&&p.l(d),d.forEach(g),this.h()},h(){I(t,"class","text-base text-drak_grey_text font-semibold leading-6 cursor-pointer"),I(s,"class",a="cursor-pointer "+(r[4]?"rotate-180":"")),I(i,"class","inline-flex gap-x-1 items-center"),I(e,"class","flex flex-col pl-[58px]")},m(_,d){S(_,e,d),v(e,i),v(i,t),v(i,l),v(i,s),C(o,s,null),v(e,f),p&&p.m(e,null),c=!0,u||(m=[ge(t,"click",Je(r[35])),ge(s,"click",r[36])],u=!0)},p(_,d){(!c||d[0]&16&&a!==(a="cursor-pointer "+(_[4]?"rotate-180":"")))&&I(s,"class",a),_[4]?p?(p.p(_,d),d[0]&16&&w(p,1)):(p=rs(_),p.c(),w(p,1),p.m(e,null)):p&&(q(),$(p,1,1,()=>{p=null}),Y())},i(_){c||(w(o.$$.fragment,_),w(p),c=!0)},o(_){$(o.$$.fragment,_),$(p),c=!1},d(_){_&&g(e),A(o),p&&p.d(),u=!1,di(m)}}}function rs(r){let e,i=[],t=new Map,n,l,s,o=ie(Re(["Beneficiary::ExcludedPerson"],r[9]));const a=f=>f[41].id;for(let f=0;f<o.length;f+=1){let c=Tn(r,o,f),u=a(c);t.set(u,i[f]=ls(u,c))}return{c(){e=P("div");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=D(f,"DIV",{class:!0});var c=B(e);for(let u=0;u<i.length;u+=1)i[u].l(c);c.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-6 pt-6")},m(f,c){S(f,e,c);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);s=!0},p(f,c){c[0]&512&&(o=ie(Re(["Beneficiary::ExcludedPerson"],f[9])),i=We(i,c,a,1,f,o,t,e,si,ls,null,Tn))},i(f){s||(f&&ni(()=>{s&&(l&&l.end(1),n=Ii(e,wt,{}),n.start())}),s=!0)},o(f){n&&n.invalidate(),f&&(l=ki(e,wt,{})),s=!1},d(f){f&&g(e);for(let c=0;c<i.length;c+=1)i[c].d();f&&l&&l.end()}}}function ls(r,e){let i,t,n=e[43]+1+"",l,s,o,a;function f(){return e[37](e[41])}return{key:r,first:null,c(){i=P("span"),t=pe("Person "),l=pe(n),s=V(),this.h()},l(c){i=D(c,"SPAN",{class:!0});var u=B(i);t=be(u,"Person "),l=be(u,n),s=T(u),u.forEach(g),this.h()},h(){I(i,"class","text-sm font-medium text-dark_grey_text leading-6 px-3 capitalize cursor-pointer"),this.first=i},m(c,u){S(c,i,u),v(i,t),v(i,l),v(i,s),o||(a=ge(i,"click",Je(f)),o=!0)},p(c,u){e=c,u[0]&512&&n!==(n=e[43]+1+"")&&Be(l,n)},d(c){c&&g(i),o=!1,a()}}}function sl(r){let e,i='<span class="text-base font-semibold text-white leading-6">4</span>';return{c(){e=P("div"),e.innerHTML=i,this.h()},l(t){e=D(t,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-18sbuyh"&&(e.innerHTML=i),this.h()},h(){I(e,"class","rounded-full h-7 w-7 bg-aasaan_logo_blue text-center")},m(t,n){S(t,e,n)},i:Me,o:Me,d(t){t&&g(e)}}}function rl(r){let e,i;return e=new Le({props:{kind:"will_step_complete"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function ll(r){let e,i;return e=new Le({props:{kind:"current_will_step"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function al(r){let e,i='<span class="text-base font-semibold text-white leading-6">5</span>';return{c(){e=P("div"),e.innerHTML=i,this.h()},l(t){e=D(t,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-35hr1g"&&(e.innerHTML=i),this.h()},h(){I(e,"class","rounded-full h-7 w-7 bg-aasaan_logo_blue text-center")},m(t,n){S(t,e,n)},i:Me,o:Me,d(t){t&&g(e)}}}function ol(r){let e,i;return e=new Le({props:{kind:"will_step_complete"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function fl(r){let e,i;return e=new Le({props:{kind:"current_will_step"}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function cl(r){let e,i,t,n,l,s,o="LEGAL DASHBOARD",a,f,c,u,m,p,_,d,b="Personal Details",y,h,k,L,E,W,M,N,z='<span class="text-lg font-semibold text-dark_grey_text leading-7 capitalize">Assets &amp; Liabilities</span>',R,Z,G,X,ne,Q,ye,ue,de,Ve,xe,Ue="Beneficiaries",je,tt=Re(["Beneficiary::Person","Beneficiary::Charity"],r[9]).length,rt,it=Re(["Beneficiary::Pet"],r[9]).length,lt,dt=Re(["Beneficiary::ExcludedPerson"],r[9]).length,fe,se,at,Ge,we,nt,_t,Mt='<span class="text-lg font-semibold text-dark_grey_text leading-7 capitalize">Asset Distribution</span>',K,re,$e,Se,Ie,ke,pt='<span class="text-lg font-semibold text-dark_grey_text leading-7 capitalize">Will Executors</span>',et,Ke,ot,ft,st,gt,ai;n=new Le({props:{kind:"aasaan_will_logo"}});const _i=[Qr,Kr,Gr],Oe=[];function Vt(ee,_e){return ee[0]==="personal-details"?0:(u==null&&(u=!Zt(["customer_detail"]).length),u?1:2)}m=Vt(r),p=Oe[m]=_i[m](r);const Di=[el,Zr,Xr],It=[];function Tt(ee,_e){return ee[0]==="assets-liabilities"?0:(L==null&&(L=!Zt(["assets","liabilities"]).length),L?1:2)}E=Tt(r),W=It[E]=Di[E](r);let Ee=r[6].length&&On(r),Pe=r[8].length&&Yn(r);const Wt=[nl,il,tl],bt=[];function oi(ee,_e){return ee[0]==="beneficiaries"?0:(Q==null&&(Q=!Zt(["beneficiaries"]).length),Q?1:2)}ye=oi(r),ue=bt[ye]=Wt[ye](r);let De=tt&&Xn(r),he=it&&ts(r),ve=dt&&ss(r);const Bi=[ll,rl,sl],kt=[];function Ft(ee,_e){return ee[0]==="asset-distribution"?0:(at==null&&(at=!Zt(["estate_distribution","residuary_estate_distribution"]).length),at?1:2)}Ge=Ft(r),we=kt[Ge]=Bi[Ge](r);const Si=[fl,ol,al],Pt=[];function jt(ee,_e){return ee[0]==="executors"?0:ee[10].executor==="available"?1:2}return $e=jt(r),Se=Pt[$e]=Si[$e](r),ft=new ht({props:{name:"goto-legal-overview",type:"secondary",text:"Back to Legal Overview",onClick:r[40]}}),{c(){e=P("div"),i=P("div"),t=P("div"),x(n.$$.fragment),l=V(),s=P("p"),s.textContent=o,a=V(),f=P("div"),c=P("div"),p.c(),_=V(),d=P("span"),d.textContent=b,y=V(),h=P("div"),k=P("div"),W.c(),M=V(),N=P("div"),N.innerHTML=z,R=V(),Ee&&Ee.c(),Z=V(),Pe&&Pe.c(),G=V(),X=P("div"),ne=P("div"),ue.c(),de=V(),Ve=P("div"),xe=P("span"),xe.textContent=Ue,je=V(),De&&De.c(),rt=V(),he&&he.c(),lt=V(),ve&&ve.c(),fe=V(),se=P("div"),we.c(),nt=V(),_t=P("div"),_t.innerHTML=Mt,K=V(),re=P("div"),Se.c(),Ie=V(),ke=P("div"),ke.innerHTML=pt,Ke=V(),ot=P("div"),x(ft.$$.fragment),this.h()},l(ee){e=D(ee,"DIV",{class:!0,style:!0});var _e=B(e);i=D(_e,"DIV",{class:!0});var yt=B(i);t=D(yt,"DIV",{class:!0});var Qe=B(t);F(n.$$.fragment,Qe),Qe.forEach(g),l=T(yt),s=D(yt,"P",{class:!0,"data-svelte-h":!0}),te(s)!=="svelte-o7hd4w"&&(s.textContent=o),yt.forEach(g),a=T(_e),f=D(_e,"DIV",{class:!0});var Ce=B(f);c=D(Ce,"DIV",{class:!0});var Dt=B(c);p.l(Dt),_=T(Dt),d=D(Dt,"SPAN",{class:!0,"data-svelte-h":!0}),te(d)!=="svelte-4gftbi"&&(d.textContent=b),Dt.forEach(g),y=T(Ce),h=D(Ce,"DIV",{class:!0});var ct=B(h);k=D(ct,"DIV",{class:!0});var vt=B(k);W.l(vt),M=T(vt),N=D(vt,"DIV",{class:!0,"data-svelte-h":!0}),te(N)!=="svelte-11qeltt"&&(N.innerHTML=z),vt.forEach(g),R=T(ct),Ee&&Ee.l(ct),Z=T(ct),Pe&&Pe.l(ct),ct.forEach(g),G=T(Ce),X=D(Ce,"DIV",{class:!0});var Bt=B(X);ne=D(Bt,"DIV",{class:!0});var Xt=B(ne);ue.l(Xt),de=T(Xt),Ve=D(Xt,"DIV",{class:!0});var ze=B(Ve);xe=D(ze,"SPAN",{class:!0,"data-svelte-h":!0}),te(xe)!=="svelte-via0sz"&&(xe.textContent=Ue),ze.forEach(g),Xt.forEach(g),je=T(Bt),De&&De.l(Bt),rt=T(Bt),he&&he.l(Bt),lt=T(Bt),ve&&ve.l(Bt),Bt.forEach(g),fe=T(Ce),se=D(Ce,"DIV",{class:!0});var Nt=B(se);we.l(Nt),nt=T(Nt),_t=D(Nt,"DIV",{class:!0,"data-svelte-h":!0}),te(_t)!=="svelte-c8gfyv"&&(_t.innerHTML=Mt),Nt.forEach(g),K=T(Ce),re=D(Ce,"DIV",{class:!0});var Ot=B(re);Se.l(Ot),Ie=T(Ot),ke=D(Ot,"DIV",{class:!0,"data-svelte-h":!0}),te(ke)!=="svelte-1qis5bn"&&(ke.innerHTML=pt),Ot.forEach(g),Ce.forEach(g),Ke=T(_e),ot=D(_e,"DIV",{class:!0});var pi=B(ot);F(ft.$$.fragment,pi),pi.forEach(g),_e.forEach(g),this.h()}
1,h(){I(t,"class","backdrop-blur-[10px] shrink-0 pl-[11px] max-w-[60px] max-h-[26px]"),I(s,"class","font-bold text-sm/[24px] text-dark_grey_text"),I(i,"class","flex gap-x-4 mx-6 pt-11 pb-[30px] border-b border-white cursor-pointer"),I(d,"class","text-lg font-semibold text-dark_grey_text leading-7 capitalize"),I(c,"class","flex justify-start items-center gap-x-4 cursor-pointer line "+(Zt(["customer_detail"]).length?"":"completed")+" svelte-9w7hx7"),I(N,"class","inline-flex items-end gap-x-2.5"),I(k,"class","flex justify-start items-center gap-x-4 cursor-pointer"),I(h,"class","flex flex-col gap-y-7 line "+(Zt(["assets","liabilities"]).length?"":"completed")+" svelte-9w7hx7"),I(xe,"class","text-lg font-semibold text-dark_grey_text leading-7 capitalize"),I(Ve,"class","inline-flex items-end gap-x-2.5"),I(ne,"class","flex justify-start items-center gap-x-4 cursor-pointer"),I(X,"class","flex flex-col gap-y-7 line "+(Zt(["beneficiaries"]).length?"":"completed")+" svelte-9w7hx7"),I(_t,"class","inline-flex items-end gap-x-2.5"),I(se,"class","flex justify-start items-center gap-x-4 cursor-pointer line "+(Zt(["estate_distribution","residuary_estate_distribution"]).length?"":"completed")+" svelte-9w7hx7"),I(ke,"class","inline-flex items-end gap-x-2.5"),I(re,"class",et="flex justify-start items-center gap-x-4 cursor-pointer line "+(r[10].executor==="available"?"completed":"")+" svelte-9w7hx7"),I(f,"class","flex flex-col gap-y-[56px] pt-[42px] pl-[60px] pr-[50px] pb-14 h-[calc(100dvh-180px)] overflow-y-auto scroller"),I(ot,"class","px-[46px] w-full pt-4 pb-[68px]"),I(e,"class","hidden md:flex flex-col h-[100dvh] overflow-hidden"),wr(e,"background","linear-gradient(180deg, rgba(48, 132, 233, 0.00) -23.7%, rgba(48, 132, 233, 0.13) 40.08%)")},m(ee,_e){S(ee,e,_e),v(e,i),v(i,t),C(n,t,null),v(i,l),v(i,s),v(e,a),v(e,f),v(f,c),Oe[m].m(c,null),v(c,_),v(c,d),v(f,y),v(f,h),v(h,k),It[E].m(k,null),v(k,M),v(k,N),v(h,R),Ee&&Ee.m(h,null),v(h,Z),Pe&&Pe.m(h,null),v(f,G),v(f,X),v(X,ne),bt[ye].m(ne,null),v(ne,de),v(ne,Ve),v(Ve,xe),v(X,je),De&&De.m(X,null),v(X,rt),he&&he.m(X,null),v(X,lt),ve&&ve.m(X,null),v(f,fe),v(f,se),kt[Ge].m(se,null),v(se,nt),v(se,_t),v(f,K),v(f,re),Pt[$e].m(re,null),v(re,Ie),v(re,ke),v(e,Ke),v(e,ot),C(ft,ot,null),st=!0,gt||(ai=[ge(i,"click",Je(r[17])),ge(c,"click",r[18]),ge(k,"click",r[19]),ge(xe,"click",Je(r[28])),ge(ne,"click",ul),ge(se,"click",r[38]),ge(re,"click",r[39])],gt=!0)},p(ee,_e){let yt=m;m=Vt(ee),m!==yt&&(q(),$(Oe[yt],1,1,()=>{Oe[yt]=null}),Y(),p=Oe[m],p||(p=Oe[m]=_i[m](ee),p.c()),w(p,1),p.m(c,_));let Qe=E;E=Tt(ee),E!==Qe&&(q(),$(It[Qe],1,1,()=>{It[Qe]=null}),Y(),W=It[E],W||(W=It[E]=Di[E](ee),W.c()),w(W,1),W.m(k,M)),ee[6].length?Ee?(Ee.p(ee,_e),_e[0]&64&&w(Ee,1)):(Ee=On(ee),Ee.c(),w(Ee,1),Ee.m(h,Z)):Ee&&(q(),$(Ee,1,1,()=>{Ee=null}),Y()),ee[8].length?Pe?(Pe.p(ee,_e),_e[0]&256&&w(Pe,1)):(Pe=Yn(ee),Pe.c(),w(Pe,1),Pe.m(h,null)):Pe&&(q(),$(Pe,1,1,()=>{Pe=null}),Y());let Ce=ye;ye=oi(ee),ye!==Ce&&(q(),$(bt[Ce],1,1,()=>{bt[Ce]=null}),Y(),ue=bt[ye],ue||(ue=bt[ye]=Wt[ye](ee),ue.c()),w(ue,1),ue.m(ne,de)),_e[0]&512&&(tt=Re(["Beneficiary::Person","Beneficiary::Charity"],ee[9]).length),tt?De?(De.p(ee,_e),_e[0]&512&&w(De,1)):(De=Xn(ee),De.c(),w(De,1),De.m(X,rt)):De&&(q(),$(De,1,1,()=>{De=null}),Y()),_e[0]&512&&(it=Re(["Beneficiary::Pet"],ee[9]).length),it?he?(he.p(ee,_e),_e[0]&512&&w(he,1)):(he=ts(ee),he.c(),w(he,1),he.m(X,lt)):he&&(q(),$(he,1,1,()=>{he=null}),Y()),_e[0]&512&&(dt=Re(["Beneficiary::ExcludedPerson"],ee[9]).length),dt?ve?(ve.p(ee,_e),_e[0]&512&&w(ve,1)):(ve=ss(ee),ve.c(),w(ve,1),ve.m(X,null)):ve&&(q(),$(ve,1,1,()=>{ve=null}),Y());let Dt=Ge;Ge=Ft(ee),Ge!==Dt&&(q(),$(kt[Dt],1,1,()=>{kt[Dt]=null}),Y(),we=kt[Ge],we||(we=kt[Ge]=Bi[Ge](ee),we.c()),w(we,1),we.m(se,nt));let ct=$e;$e=jt(ee),$e!==ct&&(q(),$(Pt[ct],1,1,()=>{Pt[ct]=null}),Y(),Se=Pt[$e],Se||(Se=Pt[$e]=Si[$e](ee),Se.c()),w(Se,1),Se.m(re,Ie)),(!st||_e[0]&1024&&et!==(et="flex justify-start items-center gap-x-4 cursor-pointer line "+(ee[10].executor==="available"?"completed":"")+" svelte-9w7hx7"))&&I(re,"class",et)},i(ee){st||(w(n.$$.fragment,ee),w(p),w(W),w(Ee),w(Pe),w(ue),w(De),w(he),w(ve),w(we),w(Se),w(ft.$$.fragment,ee),st=!0)},o(ee){$(n.$$.fragment,ee),$(p),$(W),$(Ee),$(Pe),$(ue),$(De),$(he),$(ve),$(we),$(Se),$(ft.$$.fragment,ee),st=!1},d(ee){ee&&g(e),A(n),Oe[m].d(),It[E].d(),Ee&&Ee.d(),Pe&&Pe.d(),bt[ye].d(),De&&De.d(),he&&he.d(),ve&&ve.d(),kt[Ge].d(),Pt[$e].d(),A(ft),gt=!1,di(ai)}}}const ul=()=>{};function dl(r,e,i){let t,n,l,s,o;U(r,Et,fe=>i(6,t=fe)),U(r,Ht,fe=>i(7,n=fe)),U(r,ei,fe=>i(8,l=fe)),U(r,He,fe=>i(9,s=fe)),U(r,yr,fe=>i(10,o=fe));let{currentPreviewStep:a}=e,f=!1,c=!1,u=!1,m=!1,p=!1;const _=()=>{i(1,f=!f)},d=()=>{i(5,p=!p)},b=()=>{i(2,c=!c)},y=()=>{i(3,u=!u)},h=()=>{i(4,m=!m)},k=()=>{ri("/legal-dashboard/legal_overview")},L=()=>k(),E=()=>hi("personal-details","personal-details-summary"),W=()=>hi("assets-liabilities","assets-summary"),M=()=>hi("assets-liabilities","assets-summary"),N=()=>_(),z=(fe,se)=>se.id===fe,R=(fe,se)=>$t("edit-asset-details",fe,se.id),Z=()=>hi("assets-liabilities","liabilities-summary"),G=()=>d(),X=(fe,se)=>se.id===fe,ne=(fe,se)=>$t("edit-liabilities-details",fe,se.id),Q=()=>
1hi("beneficiaries","people-and-charities-summary"),ye=()=>hi("beneficiaries","people-and-charities-summary"),ue=()=>b(),de=fe=>{Fe("edit-people-charity-details",fe.id)},Ve=()=>Fe("pets-summary"),xe=()=>y(),Ue=fe=>Fe("edit-pet-details",fe.id),je=()=>Fe("excluded-people-summary"),tt=()=>h(),rt=fe=>Fe("edit-excluded-person-details",fe.id),it=()=>Ct("assets-distribution-summary"),lt=()=>wi("executors-summary"),dt=()=>k();return r.$$set=fe=>{"currentPreviewStep"in fe&&i(0,a=fe.currentPreviewStep)},[a,f,c,u,m,p,t,n,l,s,o,_,d,b,y,h,k,L,E,W,M,N,z,R,Z,G,X,ne,Q,ye,ue,de,Ve,xe,Ue,je,tt,rt,it,lt,dt]}class _l extends ae{constructor(e){super(),oe(this,e,dl,cl,le,{currentPreviewStep:0},null,[-1,-1])}}function as(r){let e,i,t,n,l,s,o,a,f="Edit",c,u,m;return s=new Le({props:{kind:"edit"}}),{c(){e=P("div"),i=V(),t=P("div"),n=P("div"),l=P("div"),x(s.$$.fragment),o=V(),a=P("p"),a.textContent=f,this.h()},l(p){e=D(p,"DIV",{class:!0}),B(e).forEach(g),i=T(p),t=D(p,"DIV",{class:!0});var _=B(t);n=D(_,"DIV",{class:!0});var d=B(n);l=D(d,"DIV",{class:!0});var b=B(l);F(s.$$.fragment,b),o=T(b),a=D(b,"P",{class:!0,"data-svelte-h":!0}),te(a)!=="svelte-pwrpxc"&&(a.textContent=f),b.forEach(g),d.forEach(g),_.forEach(g),this.h()},h(){I(e,"class","fixed inset-0 z-50 bg-transparent"),I(a,"class","text-base font-medium leading-6 text-dark_grey_text"),I(l,"class","inline-flex gap-x-8 md:gap-x-6 items-center px-10 md:px-8 md:cursor-pointer"),I(n,"class","flex flex-col py-8 gap-y-8 md:gap-y-6 md:py-6"),I(t,"class","absolute -right-[1px] -top-[1px] bg-white z-[51] border border-light_blue rounded-xl w-[202px] md:w-[160px]")},m(p,_){S(p,e,_),S(p,i,_),S(p,t,_),v(t,n),v(n,l),C(s,l,null),v(l,o),v(l,a),c=!0,u||(m=[ge(e,"click",Je(r[6])),ge(l,"click",Je(r[7]))],u=!0)},p:Me,i(p){c||(w(s.$$.fragment,p),c=!0)},o(p){$(s.$$.fragment,p),c=!1},d(p){p&&(g(e),g(i),g(t)),A(s),u=!1,di(m)}}}function pl(r){var _n,pn,bn,hn,mn,gn,yn,vn,wn,$n,In,kn,Pn,Dn,Bn,Sn,En,xn,Cn,An;let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Personal Details</p>',t,n,l,s,o,a=(((_n=r[1])==null?void 0:_n.name)||"")+"",f,c,u,m,p,_="Father’s Name",d,b,y=":",h,k,L=(((pn=r[1])==null?void 0:pn.father_name)||"")+"",E,W,M,N,z="Gender",R,Z,G=":",X,ne,Q=(((bn=r[1])==null?void 0:bn.gender)||"")+"",ye,ue,de,Ve,xe="Date of Birth",Ue,je,tt=":",rt,it,lt=(((hn=r[1])==null?void 0:hn.date_of_birth)||"")+"",dt,fe,se,at,Ge="Religion",we,nt,_t=":",Mt,K,re=(((mn=r[1])==null?void 0:mn.religion)||"")+"",$e,Se,Ie,ke,pt="Aadhaar",et,Ke,ot=":",ft,st,gt=(((gn=r[1])==null?void 0:gn.aadhaar_number)||"")+"",ai,_i,Oe,Vt,Di="Email",It,Tt,Ee=":",Pe,Wt,bt=(((vn=(yn=r[1])==null?void 0:yn.address)==null?void 0:vn.email)||"")+"",oi,De,he,ve,Bi="Phone",kt,Ft,Si=":",Pt,jt,ee=((($n=(wn=r[1])==null?void 0:wn.address)==null?void 0:$n.phone_number)||"")+"",_e,yt,Qe,Ce,Dt="Address",ct,vt,Bt=":",Xt,ze,Nt=(((kn=(In=r[1])==null?void 0:In.address)==null?void 0:kn.line_1)||"")+"",Ot,pi,nn,Ei=(((Dn=(Pn=r[1])==null?void 0:Pn.address)==null?void 0:Dn.line_2)||"")+"",Oi,sn,xi=(((Sn=(Bn=r[1])==null?void 0:Bn.address)==null?void 0:Sn.city)||"")+"",zi,rn,Ci=(((xn=(En=r[1])==null?void 0:En.address)==null?void 0:xn.pin_code)||"")+"",Ri,ln,Ai=(((An=(Cn=r[1])==null?void 0:Cn.address)==null?void 0:An.state)||"")+"",Ji,an,bi,fi,on,Xe;fi=new Le({props:{kind:"three_dots",classes:"px-3 py-2",onClick:r[5]}});let Te=r[0]&&as(r);return{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div"),s=P("div"),o=P("p"),f=pe(a),c=V(),u=P("div"),m=P("div"),p=P("p"),p.textContent=_,d=V(),b=P("span"),b.textContent=y,h=V(),k=P("p"),E=pe(L),W=V(),M=P("div"),N=P("p"),N.textContent=z,R=V(),Z=P("span"),Z.textContent=G,X=V(),ne=P("p"),ye=pe(Q),ue=V(),de=P("div"),Ve=P("p"),Ve.textContent=xe,Ue=V(),je=P("span"),je.textContent=tt,rt=V(),it=P("p"),dt=pe(lt),fe=V(),se=P("div"),at=P("p"),at.textContent=Ge,we=V(),nt=P("span"),nt.textContent=_t,Mt=V(),K=P("p"),$e=pe(re),Se=V(),Ie=P("div"),ke=P("p"),ke.textContent=pt,et=V(),Ke=P("span"),Ke.textContent=ot,ft=V(),st=P("p"),ai=pe(gt),_i=V(),Oe=P("div"),Vt=P("p"),Vt.textContent=Di,It=V(),Tt=P("span"),Tt.textContent=Ee,Pe=V(),Wt=P("p"),oi=pe(bt),De=V(),he=P("div"),ve=P("p"),ve.textContent=Bi,kt=V(),Ft=P("span"),Ft.textContent=Si,Pt=V(),jt=P("p"),_e=pe(ee),yt=V(),Qe=P("div"),Ce=P("p"),Ce.textContent=Dt,ct=V(),vt=P("span"),vt.textContent=Bt,Xt=V(),ze=P("p"),Ot=pe(Nt),pi=V(),nn=P("br"),Oi=pe(Ei),sn=P("br"),zi=pe(xi),rn=pe(" - "),Ri=pe(Ci),ln=P("br"),Ji=pe(Ai),an=V(),bi=P("div"),x(fi.$$.fragment),on=V(),Te&&Te.c(),this.h()},l(me){e=D(me,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-1wg41k1"&&(e.innerHTML=i),t=T(me),n=D(me,"DIV",{class:!0});var Ae=B(n);l=D(Ae,"DIV",{class:!0});var Li=B(l);s=D(Li,"DIV",{class:!0});var St=B(s);o=D(St,"P",{class:!0});var Vi=B(o);f=be(Vi,a),Vi.forEach(g),c=T(St),u=D(St,"DIV",{class:!0});var Ne=B(u);m=D(Ne,"DIV",{class:!0});var zt=B(m);p=D(zt,"P",{class:!0,"data-svelte-h":!0}),te(p)!=="svelte-t7meyd"&&(p.textContent=_),d=T(zt),b=D(zt,"SPAN",{class:!0,"data-svelte-h":!0}),te(b)!=="svelte-mitlf"&&(b.textContent=y),h=T(zt),k=D(zt,"P",{class:!0});var Ti=B(k);
1E=be(Ti,L),Ti.forEach(g),zt.forEach(g),W=T(Ne),M=D(Ne,"DIV",{class:!0});var Rt=B(M);N=D(Rt,"P",{class:!0,"data-svelte-h":!0}),te(N)!=="svelte-13qalgz"&&(N.textContent=z),R=T(Rt),Z=D(Rt,"SPAN",{class:!0,"data-svelte-h":!0}),te(Z)!=="svelte-mitlf"&&(Z.textContent=G),X=T(Rt),ne=D(Rt,"P",{class:!0});var Fi=B(ne);ye=be(Fi,Q),Fi.forEach(g),Rt.forEach(g),ue=T(Ne),de=D(Ne,"DIV",{class:!0});var Jt=B(de);Ve=D(Jt,"P",{class:!0,"data-svelte-h":!0}),te(Ve)!=="svelte-9clgdm"&&(Ve.textContent=xe),Ue=T(Jt),je=D(Jt,"SPAN",{class:!0,"data-svelte-h":!0}),te(je)!=="svelte-mitlf"&&(je.textContent=tt),rt=T(Jt),it=D(Jt,"P",{class:!0});var Ni=B(it);dt=be(Ni,lt),Ni.forEach(g),Jt.forEach(g),fe=T(Ne),se=D(Ne,"DIV",{class:!0});var qt=B(se);at=D(qt,"P",{class:!0,"data-svelte-h":!0}),te(at)!=="svelte-1r3nth1"&&(at.textContent=Ge),we=T(qt),nt=D(qt,"SPAN",{class:!0,"data-svelte-h":!0}),te(nt)!=="svelte-mitlf"&&(nt.textContent=_t),Mt=T(qt),K=D(qt,"P",{class:!0});var Hi=B(K);$e=be(Hi,re),Hi.forEach(g),qt.forEach(g),Se=T(Ne),Ie=D(Ne,"DIV",{class:!0});var Yt=B(Ie);ke=D(Yt,"P",{class:!0,"data-svelte-h":!0}),te(ke)!=="svelte-uwals0"&&(ke.textContent=pt),et=T(Yt),Ke=D(Yt,"SPAN",{class:!0,"data-svelte-h":!0}),te(Ke)!=="svelte-mitlf"&&(Ke.textContent=ot),ft=T(Yt),st=D(Yt,"P",{class:!0});var Mi=B(st);ai=be(Mi,gt),Mi.forEach(g),Yt.forEach(g),_i=T(Ne),Oe=D(Ne,"DIV",{class:!0});var Ut=B(Oe);Vt=D(Ut,"P",{class:!0,"data-svelte-h":!0}),te(Vt)!=="svelte-wjutoe"&&(Vt.textContent=Di),It=T(Ut),Tt=D(Ut,"SPAN",{class:!0,"data-svelte-h":!0}),te(Tt)!=="svelte-mitlf"&&(Tt.textContent=Ee),Pe=T(Ut),Wt=D(Ut,"P",{class:!0});var Wi=B(Wt);oi=be(Wi,bt),Wi.forEach(g),Ut.forEach(g),De=T(Ne),he=D(Ne,"DIV",{class:!0});var Gt=B(he);ve=D(Gt,"P",{class:!0,"data-svelte-h":!0}),te(ve)!=="svelte-zk45ya"&&(ve.textContent=Bi),kt=T(Gt),Ft=D(Gt,"SPAN",{class:!0,"data-svelte-h":!0}),te(Ft)!=="svelte-mitlf"&&(Ft.textContent=Si),Pt=T(Gt),jt=D(Gt,"P",{class:!0});var ji=B(jt);_e=be(ji,ee),ji.forEach(g),Gt.forEach(g),yt=T(Ne),Qe=D(Ne,"DIV",{class:!0});var Kt=B(Qe);Ce=D(Kt,"P",{class:!0,"data-svelte-h":!0}),te(Ce)!=="svelte-wrf14m"&&(Ce.textContent=Dt),ct=T(Kt),vt=D(Kt,"SPAN",{class:!0,"data-svelte-h":!0}),te(vt)!=="svelte-mitlf"&&(vt.textContent=Bt),Xt=T(Kt),ze=D(Kt,"P",{class:!0});var ut=B(ze);Ot=be(ut,Nt),pi=T(ut),nn=D(ut,"BR",{}),Oi=be(ut,Ei),sn=D(ut,"BR",{}),zi=be(ut,xi),rn=be(ut," - "),Ri=be(ut,Ci),ln=D(ut,"BR",{}),Ji=be(ut,Ai),ut.forEach(g),Kt.forEach(g),Ne.forEach(g),an=T(St),bi=D(St,"DIV",{class:!0});var Ln=B(bi);F(fi.$$.fragment,Ln),Ln.forEach(g),on=T(St),Te&&Te.l(St),St.forEach(g),Li.forEach(g),Ae.forEach(g),this.h()},h(){I(e,"class","pb-[50px]"),I(o,"class","header first-letter:capitalize"),I(p,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(b,"class","mr-[46px] flex-none"),I(k,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(m,"class","flex"),I(N,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(Z,"class","mr-[46px] flex-none"),I(ne,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(M,"class","flex"),I(Ve,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(je,"class","mr-[46px] flex-none"),I(it,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(de,"class","flex"),I(at,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(nt,"class","mr-[46px] flex-none"),I(K,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(se,"class","flex"),I(ke,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(Ke,"class","mr-[46px] flex-none"),I(st,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(Ie,"class","flex"),I(Vt,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(Tt,"class","mr-[46px] flex-none"),I(Wt,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(Oe,"class","flex"),I(ve,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(Ft,"class","mr-[46px] flex-none"),I(jt,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(he,"class","flex"),I(Ce,"class","font-medium text-sm/[24px] text-light_grey_text flex-1"),I(vt,"class","mr-[46px] flex-none"),I(ze,"class","font-medium text-sm/[24px] text-dark_grey_text flex-1"),I(Qe,"class","flex"),I(u,"class","flex flex-col gap-6 overflow-hidden"),I(bi,"class","absolute top-4 right-3"),I(s,"class","relative flex box-border p-6 border bg-[#FFFFFFB2] border-[#FFFFFF33] rounded-xl shadow-[3px_3px_6px_0_#B4CBE240] flex-col gap-8 max-w-[440px]"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-260px)] overflow-y-auto pr-[44px] scroller")},m(me,Ae){S(me,e,Ae),S(me,t,Ae),S(me,n,Ae),v(n,l),v(l,s),v(s,o),v(o,f),v(s,c),v(s,u),v(u,m),v(m,p),v(m,d),v(m,b),v(m,h),v(m,k),v(k,E),v(u,W),v(u,M),v(M,N),v(M,R),v(M,Z),v(M,X),v(M,ne),v(ne,ye),v(u,ue),v(u,de),v(de,Ve),v(de,Ue),v(de,je),v(de,rt),v(de,it),v(it,dt),v(u,fe),v(u,se),v(se,at),v(se,we),v(se,nt),v(se,Mt),v(se,K),v(K,$e),v(u,Se),v(u,Ie),v(Ie,ke),v(Ie,et),v(Ie,Ke),v(Ie,ft),v(Ie,st),v(st,ai),v(u,_i),v(u,Oe),v(Oe,Vt),v(Oe,It),v(Oe,Tt),v(Oe,Pe),v(Oe,Wt),v(Wt,oi),v(u,De),v(u,he),v(he,ve),v(he,kt),v(he,Ft),v(he,Pt),v(he,jt),v(jt,_e),v(u,yt),v(u,Qe),v(Qe,Ce),v(Qe,ct),v(Qe,vt),v(Qe,Xt),v(Qe,ze),v(ze,Ot),v(ze,pi),v(ze,nn),v(ze,Oi),v(ze,sn),v(ze,zi),v(ze,rn),v(ze,Ri),v(ze,ln),v(ze,Ji),v(s,an),v(s,bi),C(fi,bi,null),v(s,on),Te&&Te.m(s,null),Xe=!0},p(me,[Ae]){var Li,St,Vi,Ne,zt,Ti,Rt,Fi,Jt,Ni,qt,Hi,Yt,Mi,Ut,Wi,Gt,ji,Kt,ut;(!Xe||Ae&2)&&a!==(a=(((Li=me[1])==null?void 0:Li.name)||"")+"")&&Be(f,a),(!Xe||Ae&2)&&L!==(L=(((St=me[1])==null?void 0:St.father_name)||"")+"")&&Be(E,L),(!Xe||Ae&2)&&Q!==(Q=(((Vi=me[1])==null?void 0:Vi.gender)||"")+"")&&Be(ye,Q),(!Xe||Ae&2)&&lt!==(lt=(((Ne=me[1])==null?void 0:Ne.date_of_birth)||"")+"")&&Be(dt,lt),(!Xe||Ae&2)&&re!==(re=(((zt=me[1])==null?void 0:zt.religion)||"")+"")&&Be($e,re),(!Xe||Ae&2)&&gt!==(gt=(((Ti=me[1])==null?void 0:Ti.aadhaar_number)||"")+"")&&Be(ai,gt),(!Xe||Ae&2)&&bt!==(bt=(((Fi=(Rt=me[1])==null?void 0:Rt.address)==null?void 0:Fi.email)||"")+"")&&Be(oi,bt),(!Xe||Ae&2)&&ee!==(ee=(((Ni=(Jt=me[1])==null?void 0:Jt.address)==null?void 0:Ni.phone_number)||"")+"")&&Be(_e,ee),(!Xe||Ae&2)&&Nt!==(Nt=(((Hi=(qt=me[1])==null?void 0:qt.address)==null?void 0:Hi.line_1)||"")+"")&&Be(Ot,Nt),(!Xe||Ae&2)&&Ei!==(Ei=(((Mi=(Yt=me[1])==null?void 0:Yt.address)==null?void 0:Mi.line_2)||"")+"")&&Be(Oi,Ei),(!Xe||Ae&2)&&xi!==(xi=(((Wi=(Ut=me[1])==null?void 0:Ut.address)==null?void 0:Wi.city)||"")+"")&&Be(zi,xi),(!Xe||Ae&2)&&Ci!==(Ci=(((ji=(Gt=me[1])==null?void 0:Gt.address)==null?void 0:ji.pin_code)||"")+"")&&Be(Ri,Ci),(!Xe||Ae&2)&&Ai!==(Ai=(((ut=(Kt=me[1])==null?void 0:Kt.address)==null?void 0:ut.state)||"")+"")&&Be(Ji,Ai),me[0]?Te?(Te.p(me,Ae),Ae&1&&w(Te,1)):(Te=as(me),Te.c(),w(Te,1),Te.m(s,null)):Te&&(q(),$(Te,1,1,()=>{Te=null}),Y())},i(me){Xe||(w(fi.$$.fragment,me),w(Te),Xe=!0)},o(me){$(fi.$$.fragment,me),$(Te),Xe=!1},d(me){me&&(g(e),g(t),g(n)),A(fi),Te&&Te.d()}}}function bl(r,e,i){let t;U(r,xt,u=>i(1,t=u));let{customerInfoPayload:n}=e,l=!1;const s=()=>{i(0,l=!l)},o=()=>{pr("edit-personal-details")},a=()=>s(),f=()=>s(),c=()=>o();return r.$$set=u=>{"customerInfoPayload"in u&&i(4,n=u.customerInfoPayload)},[l,t,s,o,n,a,f,c]}class hl extends ae{constructor(e){super(),oe(this,e,bl,pl,le,{customerInfoPayload:4})}}function ml(r){let e,i,t,n,l,s,o,a,f,c,u,m,p,_;l=new Le({props:{kind:"back-blue"}});let d={name:"save-changes",onClick:r[2],text:"Save Changes",type:"secondary",classes:"!h-9 !px-4 !py-3 !text-sm"};
1return u=new ht({props:d}),r[5](u),{c(){e=P("div"),i=P("div"),t=P("div"),n=P("span"),x(l.$$.fragment),s=V(),o=P("p"),a=pe(r[3]),f=V(),c=P("div"),x(u.$$.fragment),this.h()},l(b){e=D(b,"DIV",{class:!0});var y=B(e);i=D(y,"DIV",{class:!0});var h=B(i);t=D(h,"DIV",{class:!0});var k=B(t);n=D(k,"SPAN",{class:!0});var L=B(n);F(l.$$.fragment,L),L.forEach(g),s=T(k),o=D(k,"P",{class:!0});var E=B(o);a=be(E,r[3]),E.forEach(g),k.forEach(g),h.forEach(g),f=T(y),c=D(y,"DIV",{class:!0});var W=B(c);F(u.$$.fragment,W),W.forEach(g),y.forEach(g),this.h()},h(){I(n,"class","cursor-pointer"),I(o,"class","text-dark_grey_text text-[20px] font-semibold leading-7"),I(t,"class","inline-flex gap-x-3 items-start"),I(i,"class","flex flex-auto"),I(c,"class","flex justify-end"),I(e,"class","pb-[40px] pr-[52px] w-full flex justify-between items-center")},m(b,y){S(b,e,y),v(e,i),v(i,t),v(t,n),C(l,n,null),v(t,s),v(t,o),v(o,a),v(e,f),v(e,c),C(u,c,null),m=!0,p||(_=ge(n,"click",Je(r[4])),p=!0)},p(b,[y]){(!m||y&8)&&Be(a,b[3]);const h={};y&4&&(h.onClick=b[2]),u.$set(h)},i(b){m||(w(l.$$.fragment,b),w(u.$$.fragment,b),m=!0)},o(b){$(l.$$.fragment,b),$(u.$$.fragment,b),m=!1},d(b){b&&g(e),A(l),r[5](null),A(u),p=!1,_()}}}function gl(r,e,i){let{onBack:t,onSave:n,heading:l,saveButton:s}=e;const o=()=>t();function a(f){j[f?"unshift":"push"](()=>{s=f,i(0,s)})}return r.$$set=f=>{"onBack"in f&&i(1,t=f.onBack),"onSave"in f&&i(2,n=f.onSave),"heading"in f&&i(3,l=f.heading),"saveButton"in f&&i(0,s=f.saveButton)},[s,t,n,l,o,a]}class Ye extends ae{constructor(e){super(),oe(this,e,gl,ml,le,{onBack:1,onSave:2,heading:3,saveButton:0})}}function yl(r){let e,i,t,n,l,s,o,a,f,c,u,m,p,_;function d(M){r[6](M)}let b={onSave:r[4],onBack:r[5],heading:"Personal Details"};r[3]!==void 0&&(b.saveButton=r[3]),e=new Ye({props:b}),j.push(()=>O(e,"saveButton",d));function y(M){r[7](M)}function h(M){r[8](M)}let k={formErrors:r[2]};r[0]!==void 0&&(k.customerInfoPayload=r[0]),r[1]!==void 0&&(k.disableSaveCustomerInfo=r[1]),o=new Tr({props:k}),j.push(()=>O(o,"customerInfoPayload",y)),j.push(()=>O(o,"disableSaveCustomerInfo",h));function L(M){r[9](M)}function E(M){r[10](M)}let W={formErrors:r[2]};return r[0]!==void 0&&(W.customerInfoPayload=r[0]),r[1]!==void 0&&(W.disableSaveCustomerInfo=r[1]),u=new Fr({props:W}),j.push(()=>O(u,"customerInfoPayload",L)),j.push(()=>O(u,"disableSaveCustomerInfo",E)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("div"),x(o.$$.fragment),c=V(),x(u.$$.fragment),this.h()},l(M){F(e.$$.fragment,M),t=T(M),n=D(M,"DIV",{class:!0});var N=B(n);l=D(N,"DIV",{class:!0});var z=B(l);s=D(z,"DIV",{class:!0});var R=B(s);F(o.$$.fragment,R),c=T(R),F(u.$$.fragment,R),R.forEach(g),z.forEach(g),N.forEach(g),this.h()},h(){I(s,"class","flex flex-col gap-y-9"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(M,N){C(e,M,N),S(M,t,N),S(M,n,N),v(n,l),v(l,s),C(o,s,null),v(s,c),C(u,s,null),_=!0},p(M,[N]){const z={};!i&&N&8&&(i=!0,z.saveButton=M[3],J(()=>i=!1)),e.$set(z);const R={};N&4&&(R.formErrors=M[2]),!a&&N&1&&(a=!0,R.customerInfoPayload=M[0],J(()=>a=!1)),!f&&N&2&&(f=!0,R.disableSaveCustomerInfo=M[1],J(()=>f=!1)),o.$set(R);const Z={};N&4&&(Z.formErrors=M[2]),!m&&N&1&&(m=!0,Z.customerInfoPayload=M[0],J(()=>m=!1)),!p&&N&2&&(p=!0,Z.disableSaveCustomerInfo=M[1],J(()=>p=!1)),u.$set(Z)},i(M){_||(w(e.$$.fragment,M),w(o.$$.fragment,M),w(u.$$.fragment,M),_=!0)},o(M){$(e.$$.fragment,M),$(o.$$.fragment,M),$(u.$$.fragment,M),_=!1},d(M){M&&(g(t),g(n)),A(e,M),A(o),A(u)}}}function vl(r,e,i){let t;U(r,xt,d=>i(11,t=d));let{customerInfoPayload:n={}}=e,l=!1,s=[],o;const a=async()=>{var d;try{ce(o,!0),t?await xt.updateCustomerDetails(t.id,n):await xt.addCustomerDetails(n)}catch(b){console.error(b),b instanceof mt&&(d=b.response)!=null&&d.data.data&&(i(2,s=b.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(o,!1)}},f=()=>pr("personal-details-summary");function c(d){o=d,i(3,o)}function u(d){n=d,i(0,n)}function m(d){l=d,i(1,l)}function p(d){n=d,i(0,n)}function _(d){l=d,i(1,l)}return r.$$set=d=>{"customerInfoPayload"in d&&i(0,n=d.customerInfoPayload)},[n,l,s,o,a,f,c,u,m,p,_]}class wl extends ae{constructor(e){super(),oe(this,e,vl,yl,le,{customerInfoPayload:0})}}function os(r){let e,i,t,n;function l(a){r[3](a)}var s=r[1].component;function o(a,f){let c={};return a[0]!==void 0&&(c.customerInfoPayload=a[0]),{props:c}}return s&&(e=qe(s,o(r)),j.push(()=>O(e,"customerInfoPayload",l))),{c(){e&&x(e.$$.fragment),t=H()},l(a){e&&F(e.$$.fragment,a),t=H()}
1,m(a,f){e&&C(e,a,f),S(a,t,f),n=!0},p(a,f){if(f&2&&s!==(s=a[1].component)){if(e){q();const c=e;$(c.$$.fragment,1,0,()=>{A(c,1)}),Y()}s?(e=qe(s,o(a)),j.push(()=>O(e,"customerInfoPayload",l)),x(e.$$.fragment),w(e.$$.fragment,1),C(e,t.parentNode,t)):e=null}else if(s){const c={};!i&&f&1&&(i=!0,c.customerInfoPayload=a[0],J(()=>i=!1)),e.$set(c)}},i(a){n||(e&&w(e.$$.fragment,a),n=!0)},o(a){e&&$(e.$$.fragment,a),n=!1},d(a){a&&g(t),e&&A(e,a)}}}function $l(r){let e,i,t=r[1]&&os(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[1]?t?(t.p(n,l),l&2&&w(t,1)):(t=os(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function Il(r,e,i){let t;U(r,Ze,c=>i(2,t=c));let n,{currentFormPayload:l}=e;const s=[{id:"personal-details-summary",component:hl},{id:"edit-personal-details",component:wl}],o=()=>{i(1,n=s[0])},a=c=>{if(c){const u=c;try{Nr.parse(u),i(1,n=s.find(m=>m.id===u)),i(1,n)}catch(m){o(),console.error("will-preview::about-you::invalid-about-you-step-error ",m)}}else t.url.searchParams.has("step")&&t.url.searchParams.get("step")==="personal-details"&&o()};function f(c){l=c,i(0,l)}return r.$$set=c=>{"currentFormPayload"in c&&i(0,l=c.currentFormPayload)},r.$$.update=()=>{r.$$.dirty&4&&a(t.url.searchParams.get("personal-details-step"))},[l,n,t,f]}class kl extends ae{constructor(e){super(),oe(this,e,Il,$l,le,{currentFormPayload:0})}}function fs(r,e,i){const t=r.slice();return t[5]=e[i],t}function cs(r,e,i){const t=r.slice();return t[8]=e[i],t[10]=i,t}function us(r){let e=[],i=new Map,t,n,l=ie(Qt(r[5],r[1]));const s=o=>o[8].id;for(let o=0;o<l.length;o+=1){let a=cs(r,l,o),f=s(a);i.set(f,e[o]=ds(f,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();t=H()},l(o){for(let a=0;a<e.length;a+=1)e[a].l(o);t=H()},m(o,a){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(o,a);S(o,t,a),n=!0},p(o,a){a&14&&(l=ie(Qt(o[5],o[1])),q(),e=We(e,a,s,1,o,l,i,t.parentNode,Lt,ds,t,cs),Y())},i(o){if(!n){for(let a=0;a<l.length;a+=1)w(e[a]);n=!0}},o(o){for(let a=0;a<e.length;a+=1)$(e[a]);n=!1},d(o){o&&g(t);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function Pl(r){var t;let e,i;return e=new Hr({props:{formFieldsComponent:(t=r[2](r[5]))==null?void 0:t.assetInfoComponent,assetInfo:r[8],assetIndex:r[10],assetType:r[5],onEditFunction:r[3],showMenu:!0}}),{c(){x(e.$$.fragment)},l(n){F(e.$$.fragment,n)},m(n,l){C(e,n,l),i=!0},p(n,l){const s={};l&2&&(s.assetInfo=n[8]),l&2&&(s.assetIndex=n[10]),e.$set(s)},i(n){i||(w(e.$$.fragment,n),i=!0)},o(n){$(e.$$.fragment,n),i=!1},d(n){A(e,n)}}}function ds(r,e){let i,t=e[2](e[5]),n,l,s=t&&Pl(e);return{key:r,first:null,c(){i=H(),s&&s.c(),n=H(),this.h()},l(o){i=H(),s&&s.l(o),n=H(),this.h()},h(){this.first=i},m(o,a){S(o,i,a),s&&s.m(o,a),S(o,n,a),l=!0},p(o,a){e=o,t&&s.p(e,a)},i(o){l||(w(s),l=!0)},o(o){$(s),l=!1},d(o){o&&(g(i),g(n)),s&&s.d(o)}}}function _s(r,e){var s,o;let i,t,n,l=((s=e[0])==null?void 0:s.selected_asset_types)&&((o=e[0])==null?void 0:o.selected_asset_types[ti[e[5]]])&&us(e);return{key:r,first:null,c(){i=H(),l&&l.c(),t=H(),this.h()},l(a){i=H(),l&&l.l(a),t=H(),this.h()},h(){this.first=i},m(a,f){S(a,i,f),l&&l.m(a,f),S(a,t,f),n=!0},p(a,f){var c,u;e=a,(c=e[0])!=null&&c.selected_asset_types&&((u=e[0])!=null&&u.selected_asset_types[ti[e[5]]])?l?(l.p(e,f),f&1&&w(l,1)):(l=us(e),l.c(),w(l,1),l.m(t.parentNode,t)):l&&(q(),$(l,1,1,()=>{l=null}),Y())},i(a){n||(w(l),n=!0)},o(a){$(l),n=!1},d(a){a&&(g(i),g(t)),l&&l.d(a)}}}function Dl(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Assets</p>',t,n,l,s=[],o=new Map,a,f,c,u=ie(ci);const m=p=>p[5];for(let p=0;p<u.length;p+=1){let _=fs(r,u,p),d=m(_);o.set(d,s[p]=_s(d,_))}return f=new ht({props:{type:"tertiary",text:"Add Asset",icon:"plus",onClick:r[4],name:"add-asset",iconClasses:"h-3 w-3 mr-[10px]"}}),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div");for(let p=0;p<s.length;p+=1)s[p].c();a=V(),x(f.$$.fragment),this.h()},l(p){e=D(p,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-1w7mfrv"&&(e.innerHTML=i),t=T(p),n=D(p,"DIV",{class:!0});var _=B(n);l=D(_,"DIV",{class:!0});var d=B(l);for(let b=0;b<s.length;b+=1)s[b].l(d);a=T(d),F(f.$$.fragment,d),d.forEach(g),_.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(p,_){S(p,e,_),S(p,t,_),S(p,n,_),v(n,l);for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(l,null);v(l,a),C(f,l,null),c=!0},p(p,[_]){_&15&&(u=ie(ci),q(),s=We(s,_,m,1,p,u,o,l,Lt,_s,a,fs),Y())},i(p){if(!c){for(let _=0;_<u.length;_+=1)w(s[_]);w(f.$$.fragment,p),c=!0}},o(p){for(let _=0;_<s.length;_+=1)$(s[_]);$(f.$$.fragment,p),c=!1},d(p){p&&(g(e),g(t),g(n));for(let _=0;_<s.length;_+=1)s[_].d();A(f)}}}function Bl(r,e,i){let t,n;return U(r,Ht,a=>i(0,t=a)),U(r,Et,a=>i(1,n=a)),[t,n,a=>en.find(c=>c.id===a),(a,f)=>{$t("edit-asset-details",a,f.id)},()=>{$t("add-assets")}]}class Sl extends ae{constructor(e){super(),oe(this,e,Bl,Dl,le,{})}}function ps(r){let e,i,t,n,l,s,o,a,f;function c(b){r[12](b)}let u={onBack:r[9],onSave:r[8],heading:"Edit Assets"};r[7]!==void 0&&(u.saveButton=r[7]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(b){r[13](b)}function p(b){r[14](b)}var _=r[6].assetInfoComponent;function d(b,y){let h={currentAssetLiabilityId:b[1],assetInfo:b[3],formErrors:b[2],heading:b[6].assetIdentifier.replace(/-/g," ")+" "+(b[4]+1),showHeading:!0};return b[5]!==void 0&&(h.disableSaveAssetInfo=b[5]),b[0]!==void 0&&(h.assetInfoPayload=b[0]),{props:h}}return _&&(s=qe(_,d(r)),j.push(()=>O(s,"disableSaveAssetInfo",m)),j.push(()=>O(s,"assetInfoPayload",p))),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s&&x(s.$$.fragment),this.h()},l(b){F(e.$$.fragment,b),t=T(b),n=D(b,"DIV",{class:!0});var y=B(n);l=D(y,"DIV",{class:!0});var h=B(l);
1s&&F(s.$$.fragment,h),h.forEach(g),y.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(b,y){C(e,b,y),S(b,t,y),S(b,n,y),v(n,l),s&&C(s,l,null),f=!0},p(b,y){const h={};if(!i&&y&128&&(i=!0,h.saveButton=b[7],J(()=>i=!1)),e.$set(h),y&64&&_!==(_=b[6].assetInfoComponent)){if(s){q();const k=s;$(k.$$.fragment,1,0,()=>{A(k,1)}),Y()}_?(s=qe(_,d(b)),j.push(()=>O(s,"disableSaveAssetInfo",m)),j.push(()=>O(s,"assetInfoPayload",p)),x(s.$$.fragment),w(s.$$.fragment,1),C(s,l,null)):s=null}else if(_){const k={};y&2&&(k.currentAssetLiabilityId=b[1]),y&8&&(k.assetInfo=b[3]),y&4&&(k.formErrors=b[2]),y&80&&(k.heading=b[6].assetIdentifier.replace(/-/g," ")+" "+(b[4]+1)),!o&&y&32&&(o=!0,k.disableSaveAssetInfo=b[5],J(()=>o=!1)),!a&&y&1&&(a=!0,k.assetInfoPayload=b[0],J(()=>a=!1)),s.$set(k)}},i(b){f||(w(e.$$.fragment,b),s&&w(s.$$.fragment,b),f=!0)},o(b){$(e.$$.fragment,b),s&&$(s.$$.fragment,b),f=!1},d(b){b&&(g(t),g(n)),A(e,b),s&&A(s)}}}function El(r){let e,i,t=r[6]&&ps(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[6]?t?(t.p(n,l),l&64&&w(t,1)):(t=ps(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function xl(r,e,i){let t;U(r,Et,E=>i(11,t=E));let{currentAssetLiabilityId:n,currentAssetLiabilityType:l,formPayload:s={}}=e,o=[],a,f=0,c=!1,u,m=[],p;const _=async()=>{var E;try{i(2,o=[]),ce(p,!0),await Et.updateAsset(a.id,{assetable_attributes:{id:a.assetable_id,...s}},l)}catch(W){console.error(W),W instanceof mt&&(E=W.response)!=null&&E.data.data&&(i(2,o=W.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(p,!1)}},d=()=>{$t("assets-summary")},b=E=>{if(m.length){const W=m.find(M=>M.id===E);i(3,a=W?JSON.parse(JSON.stringify(W)):null),i(4,f=m.map(M=>M.id).indexOf(n))}},y=(E,W)=>{i(6,u=en.find(M=>M.id===E)),u&&(m=Qt(u.id,W),n&&b(n))};function h(E){p=E,i(7,p)}function k(E){c=E,i(5,c)}function L(E){s=E,i(0,s)}return r.$$set=E=>{"currentAssetLiabilityId"in E&&i(1,n=E.currentAssetLiabilityId),"currentAssetLiabilityType"in E&&i(10,l=E.currentAssetLiabilityType),"formPayload"in E&&i(0,s=E.formPayload)},r.$$.update=()=>{r.$$.dirty&2&&b(n),r.$$.dirty&3072&&y(l,t)},[s,n,o,a,f,c,u,p,_,d,l,t,h,k,L]}class Cl extends ae{constructor(e){super(),oe(this,e,xl,El,le,{currentAssetLiabilityId:1,currentAssetLiabilityType:10,formPayload:0})}}function bs(r,e,i){const t=r.slice();return t[5]=e[i],t}function hs(r,e,i){const t=r.slice();return t[8]=e[i],t[10]=i,t}function ms(r){let e=[],i=new Map,t,n,l=ie(yi(r[5],r[1]));const s=o=>o[8].id;for(let o=0;o<l.length;o+=1){let a=hs(r,l,o),f=s(a);i.set(f,e[o]=gs(f,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();t=H()},l(o){for(let a=0;a<e.length;a+=1)e[a].l(o);t=H()},m(o,a){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(o,a);S(o,t,a),n=!0},p(o,a){a&14&&(l=ie(yi(o[5],o[1])),q(),e=We(e,a,s,1,o,l,i,t.parentNode,Lt,gs,t,hs),Y())},i(o){if(!n){for(let a=0;a<l.length;a+=1)w(e[a]);n=!0}},o(o){for(let a=0;a<e.length;a+=1)$(e[a]);n=!1},d(o){o&&g(t);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function Al(r){var t,n;let e,i;return e=new Mr({props:{formFieldsComponent:(t=r[2](r[5]))==null?void 0:t.liabilityInfoComponent,liabilityInfo:r[8],liabilityHeading:((n=r[2](r[5]))==null?void 0:n.liabilityIdentifier.replace(/-/g," "))+" "+(r[10]+1),liabilityType:r[5],onEditFunction:r[3],showMenu:!0}}),{c(){x(e.$$.fragment)},l(l){F(e.$$.fragment,l)},m(l,s){C(e,l,s),i=!0},p(l,s){var a;const o={};s&2&&(o.liabilityInfo=l[8]),s&2&&(o.liabilityHeading=((a=l[2](l[5]))==null?void 0:a.liabilityIdentifier.replace(/-/g," "))+" "+(l[10]+1)),e.$set(o)},i(l){i||(w(e.$$.fragment,l),i=!0)},o(l){$(e.$$.fragment,l),i=!1},d(l){A(e,l)}}}function gs(r,e){let i,t=e[2](e[5]),n,l,s=t&&Al(e);return{key:r,first:null,c(){i=H(),s&&s.c(),n=H(),this.h()},l(o){i=H(),s&&s.l(o),n=H(),this.h()},h(){this.first=i},m(o,a){S(o,i,a),s&&s.m(o,a),S(o,n,a),l=!0},p(o,a){e=o,t&&s.p(e,a)},i(o){l||(w(s),l=!0)},o(o){$(s),l=!1},d(o){o&&(g(i),g(n)),s&&s.d(o)}}}function ys(r,e){var s,o;let i,t,n,l=((s=e[0])==null?void 0:s.selected_liability_types)&&((o=e[0])==null?void 0:o.selected_liability_types[gi[e[5]]])&&ms(e);return{key:r,first:null,c(){i=H(),l&&l.c(),t=H(),this.h()},l(a){i=H(),l&&l.l(a),t=H(),this.h()},h(){this.first=i},m(a,f){S(a,i,f),l&&l.m(a,f),S(a,t,f),n=!0},p(a,f){var c,u;e=a,(c=e[0])!=null&&c.selected_liability_types&&((u=e[0])!=null&&u.selected_liability_types[gi[e[5]]])?l?(l.p(e,f),f&1&&w(l,1)):(l=ms(e),l.c(),w(l,1),l.m(t.parentNode,t)):l&&(q(),$(l,1,1,()=>{l=null}),Y())},i(a){n||(w(l),n=!0)},o(a){$(l),n=!1},d(a){a&&(g(i),g(t)),l&&l.d(a)}}}function Ll(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Liabilities</p>',t,n,l,s=[],o=new Map,a,f,c,u=ie(Ki);const m=p=>p[5];for(let p=0;p<u.length;p+=1){let _=bs(r,u,p),d=m(_);o.set(d,s[p]=ys(d,_))}return f=new ht({props:{type:"tertiary",text:"Add Liability",icon:"plus",onClick:r[4],name:"add-liability",iconClasses:"h-3 w-3 mr-[10px]"}}),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div");for(let p=0;p<s.length;p+=1)s[p].c();a=V(),x(f.$$.fragment),this.h()},l(p){e=D(p,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-1nd4xyv"&&(e.innerHTML=i),t=T(p),n=D(p,"DIV",{class:!0});var _=B(n);l=D(_,"DIV",{class:!0});var d=B(l);for(let b=0;b<s.length;b+=1)s[b].l(d);a=T(d),F(f.$$.fragment,d),d.forEach(g),_.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(p,_){S(p,e,_),S(p,t,_),S(p,n,_),v(n,l);for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(l,null);v(l,a),C(f,l,null),c=!0},p(p,[_]){_&15&&(u=ie(Ki),q(),s=We(s,_,m,1,p,u,o,l,Lt,ys,a,bs),Y())},i(p){if(!c){for(let _=0;_<u.length;_+=1)w(s[_]);w(f.$$.fragment,p),c=!0}},o(p){for(let _=0;_<s.length;_+=1)$(s[_]);$(f.$$.fragment,p),c=!1},d(p){p&&(g(e),g(t),g(n));for(let _=0;_<s.length;_+=1)s[_].d();A(f)}}}function Vl(r,e,i){let t,n;return U(r,Ht,a=>i(0,t=a)),U(r,ei,a=>i(1,n=a)),[t,n,a=>tn.find(c=>c.id===a),(a,f)=>{$t("edit-liabilities-details",a,f.id)},()=>{$t("add-liabilities")}]}class Tl extends ae{constructor(e){super(),oe(this,e,Vl,Ll,le,{})}}function vs(r){let e,i,t,n,l,s,o,a,f;function c(b){r[12](b)}let u={onBack:r[10],onSave:r[9],heading:"Edit Liability"};r[7]!==void 0&&(u.saveButton=r[7]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(b){r[13](b)}function p(b){r[14](b)}var _=r[6].liabilityInfoComponent;function d(b,y){let h={currentAssetLiabilityId:b[1],liabilityInfo:b[4],formErrors:b[3],heading:b[6].liabilityIdentifier.replace(/-/g," ")+" "+(b[5]+1),showHeading:!0,liabilityIdentifier:b[6].liabilityIdentifier,liabilityType:b[2]};return b[8]!==void 0&&(h.disableSaveLiabilityInfo=b[8]),b[0]!==void 0&&(h.liabilityInfoPayload=b[0]),{props:h}}return _&&(s=qe(_,d(r)),j.push(()=>O(s,"disableSaveLiabilityInfo",m)),j.push(()=>O(s,"liabilityInfoPayload",p))),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s&&x(s.$$.fragment),this.h()},l(b){F(e.$$.fragment,b),t=T(b),n=D(b,"DIV",{class:!0});var y=B(n);l=D(y,"DIV",{class:!0});var h=B(l);
1s&&F(s.$$.fragment,h),h.forEach(g),y.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(b,y){C(e,b,y),S(b,t,y),S(b,n,y),v(n,l),s&&C(s,l,null),f=!0},p(b,y){const h={};if(!i&&y&128&&(i=!0,h.saveButton=b[7],J(()=>i=!1)),e.$set(h),y&64&&_!==(_=b[6].liabilityInfoComponent)){if(s){q();const k=s;$(k.$$.fragment,1,0,()=>{A(k,1)}),Y()}_?(s=qe(_,d(b)),j.push(()=>O(s,"disableSaveLiabilityInfo",m)),j.push(()=>O(s,"liabilityInfoPayload",p)),x(s.$$.fragment),w(s.$$.fragment,1),C(s,l,null)):s=null}else if(_){const k={};y&2&&(k.currentAssetLiabilityId=b[1]),y&16&&(k.liabilityInfo=b[4]),y&8&&(k.formErrors=b[3]),y&96&&(k.heading=b[6].liabilityIdentifier.replace(/-/g," ")+" "+(b[5]+1)),y&64&&(k.liabilityIdentifier=b[6].liabilityIdentifier),y&4&&(k.liabilityType=b[2]),!o&&y&256&&(o=!0,k.disableSaveLiabilityInfo=b[8],J(()=>o=!1)),!a&&y&1&&(a=!0,k.liabilityInfoPayload=b[0],J(()=>a=!1)),s.$set(k)}},i(b){f||(w(e.$$.fragment,b),s&&w(s.$$.fragment,b),f=!0)},o(b){$(e.$$.fragment,b),s&&$(s.$$.fragment,b),f=!1},d(b){b&&(g(t),g(n)),A(e,b),s&&A(s)}}}function Fl(r){let e,i,t=r[6]&&vs(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[6]?t?(t.p(n,l),l&64&&w(t,1)):(t=vs(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function Nl(r,e,i){let t;U(r,ei,E=>i(11,t=E));let{currentAssetLiabilityId:n,currentAssetLiabilityType:l,formPayload:s={}}=e,o=[],a,f=0,c,u=[],m,p=!1;const _=async()=>{var E;try{i(3,o=[]),ce(m,!0),await ei.updateLiability(a.id,{liable_attributes:{id:a.liable_id,...s}},l)}catch(W){console.error(W),W instanceof mt&&(E=W.response)!=null&&E.data.data&&(i(3,o=W.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(m,!1)}},d=()=>{$t("liabilities-summary")},b=E=>{if(u.length){const W=u.find(M=>M.id===E);i(4,a=W?JSON.parse(JSON.stringify(W)):null),i(5,f=u.map(M=>M.id).indexOf(n))}},y=(E,W)=>{i(6,c=tn.find(M=>M.id===E)),c&&(u=yi(c.id,W),n&&b(n))};function h(E){m=E,i(7,m)}function k(E){p=E,i(8,p)}function L(E){s=E,i(0,s)}return r.$$set=E=>{"currentAssetLiabilityId"in E&&i(1,n=E.currentAssetLiabilityId),"currentAssetLiabilityType"in E&&i(2,l=E.currentAssetLiabilityType),"formPayload"in E&&i(0,s=E.formPayload)},r.$$.update=()=>{r.$$.dirty&2&&b(n),r.$$.dirty&2052&&y(l,t)},[s,n,l,o,a,f,c,m,p,_,d,t,h,k,L]}class Hl extends ae{constructor(e){super(),oe(this,e,Nl,Fl,le,{currentAssetLiabilityId:1,currentAssetLiabilityType:2,formPayload:0})}}function ws(r,e,i){const t=r.slice();return t[26]=e[i],t[28]=i,t}function $s(r,e,i){const t=r.slice();return t[29]=e[i],t}function Ml(r){let e,i,t,n,l;function s(c){r[19](c)}function o(c){r[20](c)}var a=r[4].assetInfoComponent;function f(c,u){let m={currentAssetLiabilityId:c[0],assetInfo:null,formErrors:c[2],heading:c[4].assetIdentifier.replace(/-/g," ")+" "+(c[5].length+1),showHeading:!0};return c[3]!==void 0&&(m.disableSaveAssetInfo=c[3]),c[9]!==void 0&&(m.assetInfoPayload=c[9]),{props:m}}return a&&(i=qe(a,f(r)),j.push(()=>O(i,"disableSaveAssetInfo",s)),j.push(()=>O(i,"assetInfoPayload",o))),{c(){e=P("div"),i&&x(i.$$.fragment),this.h()},l(c){e=D(c,"DIV",{class:!0});var u=B(e);i&&F(i.$$.fragment,u),u.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10")},m(c,u){S(c,e,u),i&&C(i,e,null),l=!0},p(c,u){if(u[0]&16&&a!==(a=c[4].assetInfoComponent)){if(i){q();const m=i;$(m.$$.fragment,1,0,()=>{A(m,1)}),Y()}a?(i=qe(a,f(c)),j.push(()=>O(i,"disableSaveAssetInfo",s)),j.push(()=>O(i,"assetInfoPayload",o)),x(i.$$.fragment),w(i.$$.fragment,1),C(i,e,null)):i=null}else if(a){const m={};u[0]&1&&(m.currentAssetLiabilityId=c[0]),u[0]&4&&(m.formErrors=c[2]),u[0]&48&&(m.heading=c[4].assetIdentifier.replace(/-/g," ")+" "+(c[5].length+1)),!t&&u[0]&8&&(t=!0,m.disableSaveAssetInfo=c[3],J(()=>t=!1)),!n&&u[0]&512&&(n=!0,m.assetInfoPayload=c[9],J(()=>n=!1)),i.$set(m)}},i(c){l||(i&&w(i.$$.fragment,c),l=!0)},o(c){i&&$(i.$$.fragment,c),l=!1},d(c){c&&g(e),i&&A(i)}}}function Wl(r){let e,i,t,n,l,s,o,a=ie(r[1]),f=[];for(let u=0;u<a.length;u+=1)f[u]=Ps(ws(r,a,u));const c=u=>$(f[u],1,1,()=>{f[u]=null});return n=new ht({props:{name:"skip-assets-liabilities-step",text:"Cancel",type:"secondary",onClick:r[13]}}),s=new ht({props:{name:"save-selected-assets",text:"Next",disabled:!r[8],onClick:r[10]}}
1),{c(){e=P("div");for(let u=0;u<f.length;u+=1)f[u].c();i=V(),t=P("div"),x(n.$$.fragment),l=V(),x(s.$$.fragment),this.h()},l(u){e=D(u,"DIV",{class:!0});var m=B(e);for(let _=0;_<f.length;_+=1)f[_].l(m);m.forEach(g),i=T(u),t=D(u,"DIV",{class:!0});var p=B(t);F(n.$$.fragment,p),l=T(p),F(s.$$.fragment,p),p.forEach(g),this.h()},h(){I(e,"class","flex flex-col justify-between gap-y-3 mx-auto pb-8 !w-[560px]"),I(t,"class","flex gap-x-[18px] !w-[560px] mx-auto items-center justify-center")},m(u,m){S(u,e,m);for(let p=0;p<f.length;p+=1)f[p]&&f[p].m(e,null);S(u,i,m),S(u,t,m),C(n,t,null),v(t,l),C(s,t,null),o=!0},p(u,m){if(m[0]&2306){a=ie(u[1]);let _;for(_=0;_<a.length;_+=1){const d=ws(u,a,_);f[_]?(f[_].p(d,m),w(f[_],1)):(f[_]=Ps(d),f[_].c(),w(f[_],1),f[_].m(e,null))}for(q(),_=a.length;_<f.length;_+=1)c(_);Y()}const p={};m[0]&256&&(p.disabled=!u[8]),s.$set(p)},i(u){if(!o){for(let m=0;m<a.length;m+=1)w(f[m]);w(n.$$.fragment,u),w(s.$$.fragment,u),o=!0}},o(u){f=f.filter(Boolean);for(let m=0;m<f.length;m+=1)$(f[m]);$(n.$$.fragment,u),$(s.$$.fragment,u),o=!1},d(u){u&&(g(e),g(i),g(t)),nr(f,u),A(n),A(s)}}}function Is(r){let e,i=[],t=new Map,n,l,s,o=ie(r[26].subAssetsList);const a=f=>f[29].id;for(let f=0;f<o.length;f+=1){let c=$s(r,o,f),u=a(c);t.set(u,i[f]=ks(u,c))}return{c(){e=P("div");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=D(f,"DIV",{class:!0});var c=B(e);for(let u=0;u<i.length;u+=1)i[u].l(c);c.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-7 pt-7")},m(f,c){S(f,e,c);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(e,null);s=!0},p(f,c){c[0]&258&&(o=ie(f[26].subAssetsList),q(),i=We(i,c,a,1,f,o,t,e,Lt,ks,null,$s),Y())},i(f){if(!s){for(let c=0;c<o.length;c+=1)w(i[c]);f&&ni(()=>{s&&(l&&l.end(1),n=Ii(e,wt,{}),n.start())}),s=!0}},o(f){for(let c=0;c<i.length;c+=1)$(i[c]);n&&n.invalidate(),f&&(l=ki(e,wt,{})),s=!1},d(f){f&&g(e);for(let c=0;c<i.length;c+=1)i[c].d();f&&l&&l.end()}}}function ks(r,e){let i,t,n,l;function s(a){e[18](a)}let o={id:e[29].id,text:e[29].name,onAssetSelect:Ol,showInfoTitle:e[29].name,showInfoDescription:e[29].description,type:"single"};return e[8]!==void 0&&(o.selectedAssets=e[8]),t=new fr({props:o}),j.push(()=>O(t,"selectedAssets",s)),{key:r,first:null,c(){i=H(),x(t.$$.fragment),this.h()},l(a){i=H(),F(t.$$.fragment,a),this.h()},h(){this.first=i},m(a,f){S(a,i,f),C(t,a,f),l=!0},p(a,f){e=a;const c={};f[0]&2&&(c.id=e[29].id),f[0]&2&&(c.text=e[29].name),f[0]&2&&(c.showInfoTitle=e[29].name),f[0]&2&&(c.showInfoDescription=e[29].description),!n&&f[0]&256&&(n=!0,c.selectedAssets=e[8],J(()=>n=!1)),t.$set(c)},i(a){l||(w(t.$$.fragment,a),l=!0)},o(a){$(t.$$.fragment,a),l=!1},d(a){a&&g(i),A(t,a)}}}function Ps(r){let e,i,t,n,l=r[26].name+"",s,o,a,f,c,u,m,p,_,d;f=new Le({props:{kind:"expand_dark_blue"}});function b(){return r[17](r[28])}let y=r[26].expandList&&Is(r);return{c(){e=P("div"),i=P("div"),t=P("div"),n=P("span"),s=pe(l),o=V(),a=P("div"),x(f.$$.fragment),u=V(),y&&y.c(),m=V(),this.h()},l(h){e=D(h,"DIV",{class:!0});var k=B(e);i=D(k,"DIV",{class:!0});var L=B(i);t=D(L,"DIV",{class:!0});var E=B(t);n=D(E,"SPAN",{class:!0});var W=B(n);s=be(W,l),W.forEach(g),E.forEach(g),o=T(L),a=D(L,"DIV",{class:!0});var M=B(a);F(f.$$.fragment,M),M.forEach(g),L.forEach(g),u=T(k),y&&y.l(k),m=T(k),k.forEach(g),this.h()},h(){I(n,"class","text-lg font-semibold leading-8 text-[#325271] capitalize"),I(t,"class","flex-auto px-5"),I(a,"class",c="flex justify-end px-5 "+(r[26].expandList?"rotate-180":"")),I(i,"class","flex justify-between items-center md:cursor-pointer"),I(e,"class","flex flex-col flex-auto justify-start p-[30px] border-b border-[#ffffffcc] last:border-b-0 md:border-none md:mb-3 md:last:mb-0 md:bg-[#3084e921] md:rounded-xl")},m(h,k){S(h,e,k),v(e,i),v(i,t),v(t,n),v(n,s),v(i,o),v(i,a),C(f,a,null),v(e,u),y&&y.m(e,null),v(e,m),p=!0,_||(d=ge(i,"click",Je(b)),_=!0)},p(h,k){r=h,(!p||k[0]&2)&&l!==(l=r[26].name+"")&&Be(s,l),(!p||k[0]&2&&c!==(c="flex justify-end px-5 "+(r[26].expandList?"rotate-180":"")))&&I(a,"class",c),r[26].expandList?y?(y.p(r,k),k[0]&2&&w(y,1)):(y=Is(r),y.c(),w(y,1),y.m(e,m)):y&&(q(),$(y,1,1,()=>{y=null}),Y())},i(h){p||(w(f.$$.fragment,h),w(y),p=!0)},o(h){$(f.$$.fragment,h),$(y),p=!1},d(h){h&&g(e),A(f),y&&y.d(),_=!1,d()}}}function jl(r){let e,i,t,n,l,s,o;function a(p){r[16](p)}let f={onBack:r[13],onSave:r[12],heading:"Adding New Assets"};r[6]!==void 0&&(f.saveButton=r[6]),e=new Ye({props:f}),j.push(()=>O(e,"saveButton",a));const c=[Wl,Ml],u=[];function m(p,_){return p[7]?0:p[4]?1:-1}return~(l=m(r))&&(s=u[l]=c[l](r)),{c(){x(e.$$.fragment),t=V(),n=P("div"),s&&s.c(),this.h()},l(p){F(e.$$.fragment,p),t=T(p),n=D(p,"DIV",{class:!0});var _=B(n);s&&s.l(_),_.forEach(g),this.h()},h(){I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(p,_){C(e,p,_),S(p,t,_),S(p,n,_),~l&&u[l].m(n,null),o=!0},p(p,_){const d={};!i&&_[0]&64&&(i=!0,d.saveButton=p[6],J(()=>i=!1)),e.$set(d);let b=l;l=m(p),l===b?~l&&u[l].p(p,_):(s&&(q(),$(u[b],1,1,()=>{u[b]=null}),Y()),~l?(s=u[l],s?s.p(p,_):(s=u[l]=c[l](p),s.c()),w(s,1),s.m(n,null)):s=null)},i(p){o||(w(e.$$.fragment,p),w(s),o=!0)},o(p){$(e.$$.fragment,p),$(s),o=!1},d(p){p&&(g(t),g(n)),A(e,p),~l&&u[l].d()}}}const Ol=()=>{};function zl(r,e,i){let t,n,l,s;U(r,xt,G=>i(22,t=G)),U(r,Ht,G=>i(23,n=G)),U(r,Ze,G=>i(24,l=G)),U(r,Et,G=>i(25,s=G));let{currentAssetLiabilityId:o,currentAssetLiabilityType:a,formPayload:f={}}=e,c=[],u=null,m=!1,p,_=[],d,b=!0,y,h={};const k=()=>{i(7,b=!1),setTimeout(()=>{i(4,p=en.find(G=>
1G.id===y)),p&&i(5,_=Qt(p.id,s))},500)},L=G=>{i(1,qi[G].expandList=!qi[G].expandList,qi)},E=async()=>{var G;try{i(2,c=[]),ce(d,!0);const X=l.params.id;if(!X)return;if(n!=null&&n.id||await Ht.fetchWill(X),n!=null&&n.selected_asset_types&&!n.selected_asset_types[ti[y]]){const ne=JSON.parse(JSON.stringify(n.selected_asset_types)),Q=ti[y];ne[Q]=!0,await Ht.updateWill(n.id,ne,"assets")}u===null&&(p!=null&&p.assetableType?u=await Et.addAsset({assetable_attributes:{type:p.assetableType}},y,t.customer_id,X):u=await Et.addAsset({assetable_attributes:{}},y,t.customer_id,X)),u&&await Et.updateAsset(u.id,{assetable_attributes:{id:u.assetable.id,...h}},y),$t("assets-summary")}catch(X){console.error(X),X instanceof mt&&(G=X.response)!=null&&G.data.data&&i(2,c=X.response.data.data)}finally{ce(d,!1)}},W=()=>{b?$t("assets-summary"):i(7,b=!0)};function M(G){d=G,i(6,d)}const N=G=>L(G);function z(G){y=G,i(8,y)}function R(G){m=G,i(3,m)}function Z(G){h=G,i(9,h)}return r.$$set=G=>{"currentAssetLiabilityId"in G&&i(0,o=G.currentAssetLiabilityId),"currentAssetLiabilityType"in G&&i(14,a=G.currentAssetLiabilityType),"formPayload"in G&&i(15,f=G.formPayload)},[o,qi,c,m,p,_,d,b,y,h,k,L,E,W,a,f,M,N,z,R,Z]}class Rl extends ae{constructor(e){super(),oe(this,e,zl,jl,le,{currentAssetLiabilityId:0,currentAssetLiabilityType:14,formPayload:15},null,[-1,-1])}}function Ds(r,e,i){const t=r.slice();return t[23]=e[i],t}function Jl(r){let e,i,t,n,l;function s(c){r[16](c)}function o(c){r[17](c)}var a=r[1].liabilityInfoComponent;function f(c,u){let m={currentAssetLiabilityId:"",liabilityInfo:null,formErrors:c[0],heading:c[1].liabilityIdentifier.replace(/-/g," ")+" "+(c[2].length+1),showHeading:!0,liabilityIdentifier:c[1].liabilityIdentifier,liabilityType:c[6]};return c[4]!==void 0&&(m.disableSaveLiabilityInfo=c[4]),c[7]!==void 0&&(m.liabilityInfoPayload=c[7]),{props:m}}return a&&(i=qe(a,f(r)),j.push(()=>O(i,"disableSaveLiabilityInfo",s)),j.push(()=>O(i,"liabilityInfoPayload",o))),{c(){e=P("div"),i&&x(i.$$.fragment),this.h()},l(c){e=D(c,"DIV",{class:!0});var u=B(e);i&&F(i.$$.fragment,u),u.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10")},m(c,u){S(c,e,u),i&&C(i,e,null),l=!0},p(c,u){if(u&2&&a!==(a=c[1].liabilityInfoComponent)){if(i){q();const m=i;$(m.$$.fragment,1,0,()=>{A(m,1)}),Y()}a?(i=qe(a,f(c)),j.push(()=>O(i,"disableSaveLiabilityInfo",s)),j.push(()=>O(i,"liabilityInfoPayload",o)),x(i.$$.fragment),w(i.$$.fragment,1),C(i,e,null)):i=null}else if(a){const m={};u&1&&(m.formErrors=c[0]),u&6&&(m.heading=c[1].liabilityIdentifier.replace(/-/g," ")+" "+(c[2].length+1)),u&2&&(m.liabilityIdentifier=c[1].liabilityIdentifier),u&64&&(m.liabilityType=c[6]),!t&&u&16&&(t=!0,m.disableSaveLiabilityInfo=c[4],J(()=>t=!1)),!n&&u&128&&(n=!0,m.liabilityInfoPayload=c[7],J(()=>n=!1)),i.$set(m)}},i(c){l||(i&&w(i.$$.fragment,c),l=!0)},o(c){i&&$(i.$$.fragment,c),l=!1},d(c){c&&g(e),i&&A(i)}}}function ql(r){let e,i,t,n,l,s,o,a=ie(Vn),f=[];for(let u=0;u<a.length;u+=1)f[u]=Bs(Ds(r,a,u));const c=u=>$(f[u],1,1,()=>{f[u]=null});return n=new ht({props:{name:"skip-assets-liabilities-step",text:"Cancel",type:"secondary",onClick:r[10]}}),s=new ht({props:{name:"save-selected-assets",text:"Next",disabled:!r[6],onClick:r[8]}}),{c(){e=P("div");for(let u=0;u<f.length;u+=1)f[u].c();i=V(),t=P("div"),x(n.$$.fragment),l=V(),x(s.$$.fragment),this.h()},l(u){e=D(u,"DIV",{class:!0});var m=B(e);for(let _=0;_<f.length;_+=1)f[_].l(m);m.forEach(g),i=T(u),t=D(u,"DIV",{class:!0});var p=B(t);F(n.$$.fragment,p),l=T(p),F(s.$$.fragment,p),p.forEach(g),this.h()},h(){I(e,"class","flex flex-col gap-y-3 mx-auto w-full pb-8 max-w-[560px]"),I(t,"class","w-full flex gap-x-[18px] max-w-[560px] mx-auto justify-center items-center")},m(u,m){S(u,e,m);for(let p=0;p<f.length;p+=1)f[p]&&f[p].m(e,null);S(u,i,m),S(u,t,m),C(n,t,null),v(t,l),C(s,t,null),o=!0},p(u,m){if(m&64){a=ie(Vn);let _;for(_=0;_<a.length;_+=1){const d=Ds(u,a,_);f[_]?(f[_].p(d,m),w(f[_],1)):(f[_]=Bs(d),f[_].c(),w(f[_],1),f[_].m(e,null))}for(q(),_=a.length;_<f.length;_+=1)c(_);Y()}const p={};m&64&&(p.disabled=!u[6]),s.$set(p)},i(u){if(!o){for(let m=0;m<a.length;m+=1)w(f[m]);w(n.$$.fragment,u),w(s.$$.fragment,u),o=!0}},o(u){f=f.filter(Boolean);for(let m=0;m<f.length;m+=1)$(f[m]);$(n.$$.fragment,u),$(s.$$.fragment,u),o=!1},d(u){u&&(g(e),g(i),g(t)),nr(f,u),A(n),A(s)}}}function Bs(r){let e,i,t;function n(s){r[15](s)}let l={id:r[23].id,text:r[23].id.replace(/-/g," "),onAssetSelect:Ul,showInfoTitle:r[23].id.replace(/-/g," "),showInfoDescription:r[23].description,type:"single"};return r[6]!==void 0&&(l.selectedAssets=r[6]),e=new fr({props:l}),j.push(()=>O(e,"selectedAssets",n)),{c(){x(e.$$.fragment)},l(s){F(e.$$.fragment,s)},m(s,o){C(e,s,o),t=!0},p(s,o){const a={};!i&&o&64&&(i=!0,a.selectedAssets=s[6],J(()=>
1i=!1)),e.$set(a)},i(s){t||(w(e.$$.fragment,s),t=!0)},o(s){$(e.$$.fragment,s),t=!1},d(s){A(e,s)}}}function Yl(r){let e,i,t,n,l,s,o;function a(p){r[14](p)}let f={onBack:r[10],onSave:r[9],heading:"Adding New Liability"};r[3]!==void 0&&(f.saveButton=r[3]),e=new Ye({props:f}),j.push(()=>O(e,"saveButton",a));const c=[ql,Jl],u=[];function m(p,_){return p[5]?0:p[1]?1:-1}return~(l=m(r))&&(s=u[l]=c[l](r)),{c(){x(e.$$.fragment),t=V(),n=P("div"),s&&s.c(),this.h()},l(p){F(e.$$.fragment,p),t=T(p),n=D(p,"DIV",{class:!0});var _=B(n);s&&s.l(_),_.forEach(g),this.h()},h(){I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(p,_){C(e,p,_),S(p,t,_),S(p,n,_),~l&&u[l].m(n,null),o=!0},p(p,[_]){const d={};!i&&_&8&&(i=!0,d.saveButton=p[3],J(()=>i=!1)),e.$set(d);let b=l;l=m(p),l===b?~l&&u[l].p(p,_):(s&&(q(),$(u[b],1,1,()=>{u[b]=null}),Y()),~l?(s=u[l],s?s.p(p,_):(s=u[l]=c[l](p),s.c()),w(s,1),s.m(n,null)):s=null)},i(p){o||(w(e.$$.fragment,p),w(s),o=!0)},o(p){$(e.$$.fragment,p),$(s),o=!1},d(p){p&&(g(t),g(n)),A(e,p),~l&&u[l].d()}}}const Ul=()=>{};function Gl(r,e,i){let t,n,l,s;U(r,xt,R=>i(19,t=R)),U(r,Ht,R=>i(20,n=R)),U(r,Ze,R=>i(21,l=R)),U(r,ei,R=>i(22,s=R));let{currentAssetLiabilityId:o,currentAssetLiabilityType:a,formPayload:f={}}=e,c=[],u=null,m,p=[],_,d=!1,b=!0,y,h={};const k=()=>{i(5,b=!1),setTimeout(()=>{i(1,m=tn.find(R=>R.id===y)),m&&i(2,p=yi(m.id,s))},200)},L=async()=>{var R;try{i(0,c=[]),ce(_,!0);const Z=l.params.id;if(!Z)return;if(n!=null&&n.id||await Ht.fetchWill(Z),n!=null&&n.selected_liability_types&&!n.selected_liability_types[gi[y]]){const G=JSON.parse(JSON.stringify(n.selected_liability_types)),X=gi[y];G[X]=!0,await Ht.updateWill(n.id,G,"liabilities")}u===null&&(u=await ei.addLiability({liable_attributes:{}},y,t.customer_id,Z)),u&&await ei.updateLiability(u.id,{liable_attributes:{id:u.liable_id,...h}},y),$t("liabilities-summary")}catch(Z){console.error(Z),Z instanceof mt&&(R=Z.response)!=null&&R.data.data&&i(0,c=Z.response.data.data)}finally{ce(_,!1)}},E=()=>{b?$t("liabilities-summary"):i(5,b=!0)};function W(R){_=R,i(3,_)}function M(R){y=R,i(6,y)}function N(R){d=R,i(4,d)}function z(R){h=R,i(7,h)}return r.$$set=R=>{"currentAssetLiabilityId"in R&&i(11,o=R.currentAssetLiabilityId),"currentAssetLiabilityType"in R&&i(12,a=R.currentAssetLiabilityType),"formPayload"in R&&i(13,f=R.formPayload)},[c,m,p,_,d,b,y,h,k,L,E,o,a,f,W,M,N,z]}class Kl extends ae{constructor(e){super(),oe(this,e,Gl,Yl,le,{currentAssetLiabilityId:11,currentAssetLiabilityType:12,formPayload:13})}}function Ss(r){let e,i,t,n;function l(a){r[5](a)}var s=r[1].component;function o(a,f){let c={currentAssetLiabilityId:a[3],currentAssetLiabilityType:a[2]};return a[0]!==void 0&&(c.formPayload=a[0]),{props:c}}return s&&(e=qe(s,o(r)),j.push(()=>O(e,"formPayload",l))),{c(){e&&x(e.$$.fragment),t=H()},l(a){e&&F(e.$$.fragment,a),t=H()},m(a,f){e&&C(e,a,f),S(a,t,f),n=!0},p(a,f){if(f&2&&s!==(s=a[1].component)){if(e){q();const c=e;$(c.$$.fragment,1,0,()=>{A(c,1)}),Y()}s?(e=qe(s,o(a)),j.push(()=>O(e,"formPayload",l)),x(e.$$.fragment),w(e.$$.fragment,1),C(e,t.parentNode,t)):e=null}else if(s){const c={};f&8&&(c.currentAssetLiabilityId=a[3]),f&4&&(c.currentAssetLiabilityType=a[2]),!i&&f&1&&(i=!0,c.formPayload=a[0],J(()=>i=!1)),e.$set(c)}},i(a){n||(e&&w(e.$$.fragment,a),n=!0)},o(a){e&&$(e.$$.fragment,a),n=!1},d(a){a&&g(t),e&&A(e,a)}}}function Ql(r){let e,i,t=r[1]&&Ss(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[1]?t?(t.p(n,l),l&2&&w(t,1)):(t=Ss(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function Xl(r,e,i){let t;U(r,Ze,_=>i(4,t=_));let n,l,s=null,{currentFormPayload:o}=e;const a=[{id:"assets-summary",component:Sl},{id:"edit-asset-details",component:Cl},{id:"liabilities-summary",component:Tl},{id:"edit-liabilities-details",component:Hl},{id:"add-assets",component:Rl},{id:"add-liabilities",component:Kl}],f=()=>{i(1,n=a[0])},c=_=>{if(_){const d=_;try{Wr.parse(d),i(1,n=a.find(b=>b.id===d))}catch(b){f(),console.error("will-preview::assets-liabilities-step::invalid-assets-liabilities-step-step-error ",b)}}else t.url.searchParams.has("step")&&t.url.searchParams.get("step")==="assets-liabilities"&&f()},u=_=>{i(2,l=_)},m=_=>{i(3,s=_)};function p(_){o=_,i(0,o)}return r.$$set=_=>{"currentFormPayload"in _&&i(0,o=_.currentFormPayload)},r.$$.update=()=>{r.$$.dirty&16&&c(t.url.searchParams.get("assets-liabilities-step")),r.$$.dirty&16&&u(t.url.
1searchParams.get("assets-liabilities-type")),r.$$.dirty&16&&m(t.url.searchParams.get("assets-liabilities-id"))},[o,n,l,s,t,p]}class Zl extends ae{constructor(e){super(),oe(this,e,Xl,Ql,le,{currentFormPayload:0})}}function Es(r,e,i){const t=r.slice();return t[5]=e[i],t[7]=i,t}function xs(r,e){let i,t,n;return t=new fn({props:{formFieldsComponent:e[5].beneficiarable_type==="Beneficiary::Person"?Xi:Zi,beneficiaryInfo:e[5],beneficiaryIndex:e[7],beneficiarableType:e[5].beneficiarable_type,showMenu:!0,onEditFunction:e[1]}}),{key:r,first:null,c(){i=H(),x(t.$$.fragment),this.h()},l(l){i=H(),F(t.$$.fragment,l),this.h()},h(){this.first=i},m(l,s){S(l,i,s),C(t,l,s),n=!0},p(l,s){e=l;const o={};s&1&&(o.formFieldsComponent=e[5].beneficiarable_type==="Beneficiary::Person"?Xi:Zi),s&1&&(o.beneficiaryInfo=e[5]),s&1&&(o.beneficiaryIndex=e[7]),s&1&&(o.beneficiarableType=e[5].beneficiarable_type),t.$set(o)},i(l){n||(w(t.$$.fragment,l),n=!0)},o(l){$(t.$$.fragment,l),n=!1},d(l){l&&g(i),A(t,l)}}}function ea(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Beneficiaries</p>',t,n,l,s,o=[],a=new Map,f,c,u,m=ie(r[0]);const p=_=>_[5].id;for(let _=0;_<m.length;_+=1){let d=Es(r,m,_),b=p(d);a.set(b,o[_]=xs(b,d))}return c=new ht({props:{type:"tertiary",text:"Add Beneficiary",icon:"plus",onClick:r[4],name:"add-beneficiary",iconClasses:"h-3 w-3 mr-[10px]"}}),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div"),s=P("div");for(let _=0;_<o.length;_+=1)o[_].c();f=V(),x(c.$$.fragment),this.h()},l(_){e=D(_,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-uvu961"&&(e.innerHTML=i),t=T(_),n=D(_,"DIV",{class:!0});var d=B(n);l=D(d,"DIV",{class:!0});var b=B(l);s=D(b,"DIV",{class:!0});var y=B(s);for(let h=0;h<o.length;h+=1)o[h].l(y);y.forEach(g),f=T(b),F(c.$$.fragment,b),b.forEach(g),d.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(s,"class","flex flex-col gap-y-6"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(_,d){S(_,e,d),S(_,t,d),S(_,n,d),v(n,l),v(l,s);for(let b=0;b<o.length;b+=1)o[b]&&o[b].m(s,null);v(l,f),C(c,l,null),u=!0},p(_,[d]){d&3&&(m=ie(_[0]),q(),o=We(o,d,p,1,_,m,a,s,Lt,xs,null,Es),Y())},i(_){if(!u){for(let d=0;d<m.length;d+=1)w(o[d]);w(c.$$.fragment,_),u=!0}},o(_){for(let d=0;d<o.length;d+=1)$(o[d]);$(c.$$.fragment,_),u=!1},d(_){_&&(g(e),g(t),g(n));for(let d=0;d<o.length;d+=1)o[d].d();A(c)}}}function ta(r,e,i){let t;U(r,He,a=>i(3,t=a));let n=[];const l=a=>{Fe("edit-people-charity-details",a.id)},s=()=>{Fe("add-people-charity-details")},o=()=>s();return r.$$.update=()=>{r.$$.dirty&8&&i(0,n=Re(["Beneficiary::Person","Beneficiary::Charity"],t))},[n,l,s,t,o]}class ia extends ae{constructor(e){super(),oe(this,e,ta,ea,le,{})}}function Cs(r,e,i){const t=r.slice();return t[6]=e[i],t[8]=i,t}function As(r,e){let i,t,n;return t=new fn({props:{formFieldsComponent:cn,beneficiaryInfo:e[6],beneficiaryIndex:e[8],beneficiarableType:e[6].beneficiarable_type,showMenu:!0,onEditFunction:e[1]}}),{key:r,first:null,c(){i=H(),x(t.$$.fragment),this.h()},l(l){i=H(),F(t.$$.fragment,l),this.h()},h(){this.first=i},m(l,s){S(l,i,s),C(t,l,s),n=!0},p(l,s){e=l;const o={};s&1&&(o.beneficiaryInfo=e[6]),s&1&&(o.beneficiaryIndex=e[8]),s&1&&(o.beneficiarableType=e[6].beneficiarable_type),t.$set(o)},i(l){n||(w(t.$$.fragment,l),n=!0)},o(l){$(t.$$.fragment,l),n=!1},d(l){l&&g(i),A(t,l)}}}function na(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Pets</p>',t,n,l,s,o=[],a=new Map,f,c,u,m=ie(r[0]);const p=_=>_[6].id;for(let _=0;_<m.length;_+=1){let d=Cs(r,m,_),b=p(d);a.set(b,o[_]=As(b,d))}return c=new ht({props:{type:"tertiary",text:"Add Pet",icon:"plus",onClick:r[4],name:"add-beneficiary",iconClasses:"h-3 w-3 mr-[10px]",classes:"mx-auto !w-[560px] mt-5"}}),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div"),s=P("div");for(let _=0;_<o.length;_+=1)o[_].c();f=V(),x(c.$$.fragment),this.h()},l(_){e=D(_,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-17vh0js"&&(e.innerHTML=i),t=T(_),n=D(_,"DIV",{class:!0});var d=B(n);l=D(d,"DIV",{class:!0});var b=B(l);s=D(b,"DIV",{class:!0});var y=B(s);for(let h=0;h<o.length;h+=1)o[h].l(y);
1y.forEach(g),b.forEach(g),f=T(d),F(c.$$.fragment,d),d.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(s,"class","flex flex-col gap-y-6"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(_,d){S(_,e,d),S(_,t,d),S(_,n,d),v(n,l),v(l,s);for(let b=0;b<o.length;b+=1)o[b]&&o[b].m(s,null);v(n,f),C(c,n,null),u=!0},p(_,[d]){d&3&&(m=ie(_[0]),q(),o=We(o,d,p,1,_,m,a,s,Lt,As,null,Cs),Y())},i(_){if(!u){for(let d=0;d<m.length;d+=1)w(o[d]);w(c.$$.fragment,_),u=!0}},o(_){for(let d=0;d<o.length;d+=1)$(o[d]);$(c.$$.fragment,_),u=!1},d(_){_&&(g(e),g(t),g(n));for(let d=0;d<o.length;d+=1)o[d].d();A(c)}}}function sa(r,e,i){let t;U(r,He,f=>i(3,t=f));let n=[];const l=f=>{i(0,n=Re(["Beneficiary::Pet"],f))},s=f=>{Fe("edit-pet-details",f.id)},o=()=>{Fe("add-pet-details")},a=()=>o();return r.$$.update=()=>{r.$$.dirty&8&&l(t)},[n,s,o,t,a]}class ra extends ae{constructor(e){super(),oe(this,e,sa,na,le,{})}}function Ls(r,e,i){const t=r.slice();return t[6]=e[i],t[8]=i,t}function Vs(r,e){let i,t,n;return t=new fn({props:{formFieldsComponent:un,beneficiaryInfo:e[6],beneficiaryIndex:e[8],beneficiarableType:e[6].beneficiarable_type,showMenu:!0,onEditFunction:e[1]}}),{key:r,first:null,c(){i=H(),x(t.$$.fragment),this.h()},l(l){i=H(),F(t.$$.fragment,l),this.h()},h(){this.first=i},m(l,s){S(l,i,s),C(t,l,s),n=!0},p(l,s){e=l;const o={};s&1&&(o.beneficiaryInfo=e[6]),s&1&&(o.beneficiaryIndex=e[8]),s&1&&(o.beneficiarableType=e[6].beneficiarable_type),t.$set(o)},i(l){n||(w(t.$$.fragment,l),n=!0)},o(l){$(t.$$.fragment,l),n=!1},d(l){l&&g(i),A(t,l)}}}function la(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Excluded People</p>',t,n,l,s,o=[],a=new Map,f,c,u,m=ie(r[0]);const p=_=>_[6].id;for(let _=0;_<m.length;_+=1){let d=Ls(r,m,_),b=p(d);a.set(b,o[_]=Vs(b,d))}return c=new ht({props:{type:"tertiary",text:"Add Person",icon:"plus",onClick:r[4],name:"add-beneficiary",iconClasses:"h-3 w-3 mr-[10px]",classes:"mx-auto !w-[560px] mt-5"}}),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div"),s=P("div");for(let _=0;_<o.length;_+=1)o[_].c();f=V(),x(c.$$.fragment),this.h()},l(_){e=D(_,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-8ptzm1"&&(e.innerHTML=i),t=T(_),n=D(_,"DIV",{class:!0});var d=B(n);l=D(d,"DIV",{class:!0});var b=B(l);s=D(b,"DIV",{class:!0});var y=B(s);for(let h=0;h<o.length;h+=1)o[h].l(y);y.forEach(g),b.forEach(g),f=T(d),F(c.$$.fragment,d),d.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(s,"class","flex flex-col gap-y-6"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(_,d){S(_,e,d),S(_,t,d),S(_,n,d),v(n,l),v(l,s);for(let b=0;b<o.length;b+=1)o[b]&&o[b].m(s,null);v(n,f),C(c,n,null),u=!0},p(_,[d]){d&3&&(m=ie(_[0]),q(),o=We(o,d,p,1,_,m,a,s,Lt,Vs,null,Ls),Y())},i(_){if(!u){for(let d=0;d<m.length;d+=1)w(o[d]);w(c.$$.fragment,_),u=!0}},o(_){for(let d=0;d<o.length;d+=1)$(o[d]);$(c.$$.fragment,_),u=!1},d(_){_&&(g(e),g(t),g(n));for(let d=0;d<o.length;d+=1)o[d].d();A(c)}}}function aa(r,e,i){let t;U(r,He,f=>i(3,t=f));let n=[];const l=f=>{i(0,n=Re(["Beneficiary::ExcludedPerson"],f))},s=f=>{Fe("edit-excluded-person-details",f.id)},o=()=>{Fe("add-excluded-person-details")},a=()=>o();return r.$$.update=()=>{r.$$.dirty&8&&l(t)},[n,s,o,t,a]}class oa extends ae{constructor(e){super(),oe(this,e,aa,la,le,{})}}function Ts(r){let e,i,t,n,l,s,o,a;function f(_){r[12](_)}let c={onBack:r[11],onSave:r[10],heading:"Edit Beneficiaries"};r[6]!==void 0&&(c.saveButton=r[6]),e=new Ye({props:c}),j.push(()=>O(e,"saveButton",f));const u=[ca,fa],m=[];function p(_,d){return _[2]==="Beneficiary::Person"?0:1}return s=p(r),o=m[s]=u[s](r),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),o.c(),this.h()},l(_){F(e.$$.fragment,_),t=T(_),n=D(_,"DIV",{class:!0});var d=B(n);l=D(d,"DIV",{class:!0});var b=B(l);o.l(b),b.forEach(g),d.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(_,d){C(e,_,d),S(_,t,d),S(_,n,d),v(n,l),m[s].m(l,null),a=!0},p(_,d){const b={};!i&&d&64&&(i=!0,b.saveButton=_[6],J(()=>i=!1)),e.$set(b);let y=s;s=p(_),s===y?m[s].p(_,d):(q(),$(m[y],1,1,()=>{m[y]=null}),Y(),o=m[s],o?o.p(_,d):(o=m[s]=u[s](_),o.c()),w(o,1),o.m(l,null))},i(_){a||(w(e.$$.fragment,_),w(o),a=!0)},o(_){$(e.$$.fragment,_),$(o),a=!1},d(_){_&&(g(t),g(n)),A(e,_),m[s].d()}}}function fa(r){let e,i,t,n;function l(a){r[15](a)}
1function s(a){r[16](a)}let o={beneficiaryInfo:r[4],beneficiaryId:r[1],formErrors:r[7],showHeading:!r[1],heading:"Beneficiary "+(r[5]+1)};return r[3]!==void 0&&(o.disableSaveBeneficiaryInfo=r[3]),r[0]!==void 0&&(o.beneficiaryInfoPayload=r[0]),e=new Zi({props:o}),j.push(()=>O(e,"disableSaveBeneficiaryInfo",l)),j.push(()=>O(e,"beneficiaryInfoPayload",s)),{c(){x(e.$$.fragment)},l(a){F(e.$$.fragment,a)},m(a,f){C(e,a,f),n=!0},p(a,f){const c={};f&16&&(c.beneficiaryInfo=a[4]),f&2&&(c.beneficiaryId=a[1]),f&128&&(c.formErrors=a[7]),f&2&&(c.showHeading=!a[1]),f&32&&(c.heading="Beneficiary "+(a[5]+1)),!i&&f&8&&(i=!0,c.disableSaveBeneficiaryInfo=a[3],J(()=>i=!1)),!t&&f&1&&(t=!0,c.beneficiaryInfoPayload=a[0],J(()=>t=!1)),e.$set(c)},i(a){n||(w(e.$$.fragment,a),n=!0)},o(a){$(e.$$.fragment,a),n=!1},d(a){A(e,a)}}}function ca(r){let e,i,t,n;function l(a){r[13](a)}function s(a){r[14](a)}let o={beneficiaryInfo:r[4],formErrors:r[7],beneficiaryId:r[1],kind:r[8],showHeading:!r[1],heading:"Beneficiary "+(r[5]+1),willId:r[9]};return r[0]!==void 0&&(o.beneficiaryInfoPayload=r[0]),r[3]!==void 0&&(o.disableSaveBeneficiaryInfo=r[3]),e=new Xi({props:o}),j.push(()=>O(e,"beneficiaryInfoPayload",l)),j.push(()=>O(e,"disableSaveBeneficiaryInfo",s)),{c(){x(e.$$.fragment)},l(a){F(e.$$.fragment,a)},m(a,f){C(e,a,f),n=!0},p(a,f){const c={};f&16&&(c.beneficiaryInfo=a[4]),f&128&&(c.formErrors=a[7]),f&2&&(c.beneficiaryId=a[1]),f&256&&(c.kind=a[8]),f&2&&(c.showHeading=!a[1]),f&32&&(c.heading="Beneficiary "+(a[5]+1)),!i&&f&1&&(i=!0,c.beneficiaryInfoPayload=a[0],J(()=>i=!1)),!t&&f&8&&(t=!0,c.disableSaveBeneficiaryInfo=a[3],J(()=>t=!1)),e.$set(c)},i(a){n||(w(e.$$.fragment,a),n=!0)},o(a){$(e.$$.fragment,a),n=!1},d(a){A(e,a)}}}function ua(r){let e,i,t=r[4]&&Ts(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[4]?t?(t.p(n,l),l&16&&w(t,1)):(t=Ts(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function da(r,e,i){let t,n;U(r,He,z=>i(19,t=z)),U(r,Ze,z=>i(20,n=z));let{beneficiaryId:l,beneficiaryInfoPayload:s}=e,o="Beneficiary::Person",a=!1,f=null,c=0,u=[],m=null,p,_=[],d;const b=n.params.id,y=async()=>{var z;try{ce(p,!0),!f&&!m&&(m=await He.addBeneficiary({beneficiarable_type:o,beneficiarable_attributes:{}})),m&&await He.updateBeneficiary(m.id,{beneficiarable_type:o,beneficiarable_attributes:{id:m.beneficiarable_id,...s}}),f&&await He.updateBeneficiary(f.id,{beneficiarable_type:o,beneficiarable_attributes:{id:f.beneficiarable_id,...s}})}catch(R){console.error(R),R instanceof mt&&(z=R.response)!=null&&z.data.data&&(i(7,_=R.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(p,!1)}},h=()=>{Fe("people-and-charities-summary")},k=z=>{if(z&&(u=Re(["Beneficiary::Person","Beneficiary::Charity"],t),u.length)){const R=u.find(Z=>Z.id===z);i(4,f=R?JSON.parse(JSON.stringify(R)):null),f&&i(2,o=f.beneficiarable_type),i(5,c=u.map(Z=>Z.id).indexOf(z)),(f==null?void 0:f.beneficiarable.relationship)==="spouse"?i(8,d="spouse"):(f==null?void 0:f.beneficiarable.relationship)==="son"||(f==null?void 0:f.beneficiarable.relationship)==="daughter"?i(8,d="child"):f!=null&&f.beneficiarable.is_guardian?i(8,d="guardian"):i(8,d="other")}};function L(z){p=z,i(6,p)}function E(z){s=z,i(0,s)}function W(z){a=z,i(3,a)}function M(z){a=z,i(3,a)}function N(z){s=z,i(0,s)}return r.$$set=z=>{"beneficiaryId"in z&&i(1,l=z.beneficiaryId),"beneficiaryInfoPayload"in z&&i(0,s=z.beneficiaryInfoPayload)},r.$$.update=()=>{r.$$.dirty&2&&k(l)},[s,l,o,a,f,c,p,_,d,b,y,h,L,E,W,M,N]}class _a extends ae{constructor(e){super(),oe(this,e,da,ua,le,{beneficiaryId:1,beneficiaryInfoPayload:0})}}function Fs(r){let e,i,t,n,l,s,o,a,f;function c(d){r[10](d)}let u={onBack:r[9],onSave:r[8],heading:"Edit Pets"};r[5]!==void 0&&(u.saveButton=r[5]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(d){r[11](d)}function p(d){r[12](d)}let _={beneficiaryInfo:r[2],showHeading:!0,beneficiaryId:r[1],heading:"Pet "+(r[4]+1),formErrors:r[6],willId:r[7]};return r[0]!==void 0&&(_.beneficiaryInfoPayload=r[0]),r[3]!==void 0&&(_.disableSaveBeneficiaryInfo=r[3]),s=new cn({props:_}),j.push(()=>O(s,"beneficiaryInfoPayload",m)),j.push(()=>
1O(s,"disableSaveBeneficiaryInfo",p)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),x(s.$$.fragment),this.h()},l(d){F(e.$$.fragment,d),t=T(d),n=D(d,"DIV",{class:!0});var b=B(n);l=D(b,"DIV",{class:!0});var y=B(l);F(s.$$.fragment,y),y.forEach(g),b.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(d,b){C(e,d,b),S(d,t,b),S(d,n,b),v(n,l),C(s,l,null),f=!0},p(d,b){const y={};!i&&b&32&&(i=!0,y.saveButton=d[5],J(()=>i=!1)),e.$set(y);const h={};b&4&&(h.beneficiaryInfo=d[2]),b&2&&(h.beneficiaryId=d[1]),b&16&&(h.heading="Pet "+(d[4]+1)),b&64&&(h.formErrors=d[6]),!o&&b&1&&(o=!0,h.beneficiaryInfoPayload=d[0],J(()=>o=!1)),!a&&b&8&&(a=!0,h.disableSaveBeneficiaryInfo=d[3],J(()=>a=!1)),s.$set(h)},i(d){f||(w(e.$$.fragment,d),w(s.$$.fragment,d),f=!0)},o(d){$(e.$$.fragment,d),$(s.$$.fragment,d),f=!1},d(d){d&&(g(t),g(n)),A(e,d),A(s)}}}function pa(r){let e,i,t=r[2]&&Fs(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[2]?t?(t.p(n,l),l&4&&w(t,1)):(t=Fs(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function ba(r,e,i){let t,n;U(r,He,L=>i(14,t=L)),U(r,Ze,L=>i(15,n=L));let{beneficiaryId:l,beneficiaryInfoPayload:s={}}=e,o,a=!1,f=0,c=[],u,m=[];const p=n.params.id,_=async()=>{var L;try{ce(u,!0),await He.updateBeneficiary(o.id,{beneficiarable_type:"Beneficiary::Pet",beneficiarable_attributes:{id:o.beneficiarable_id,...s}})}catch(E){console.error(E),E instanceof mt&&(L=E.response)!=null&&L.data.data&&(i(6,m=E.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(u,!1)}},d=()=>{Fe("pets-summary")},b=L=>{if(L&&(c=Re(["Beneficiary::Pet"],t),c.length)){const E=c.find(W=>W.id===L);i(2,o=E?JSON.parse(JSON.stringify(E)):null),i(4,f=c.map(W=>W.id).indexOf(L))}};function y(L){u=L,i(5,u)}function h(L){s=L,i(0,s)}function k(L){a=L,i(3,a)}return r.$$set=L=>{"beneficiaryId"in L&&i(1,l=L.beneficiaryId),"beneficiaryInfoPayload"in L&&i(0,s=L.beneficiaryInfoPayload)},r.$$.update=()=>{r.$$.dirty&2&&b(l)},[s,l,o,a,f,u,m,p,_,d,y,h,k]}class ha extends ae{constructor(e){super(),oe(this,e,ba,pa,le,{beneficiaryId:1,beneficiaryInfoPayload:0})}}function Ns(r){let e,i,t,n,l,s,o,a,f;function c(d){r[10](d)}let u={onBack:r[8],onSave:r[7],heading:"Edit Excluded People"};r[5]!==void 0&&(u.saveButton=r[5]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(d){r[11](d)}function p(d){r[12](d)}let _={beneficiaryInfo:r[2],showHeading:!0,beneficiaryId:r[1],heading:"Person "+(r[4]+1),formErrors:r[6]};return r[0]!==void 0&&(_.beneficiaryInfoPayload=r[0]),r[3]!==void 0&&(_.disableSaveBeneficiaryInfo=r[3]),s=new un({props:_}),j.push(()=>O(s,"beneficiaryInfoPayload",m)),j.push(()=>O(s,"disableSaveBeneficiaryInfo",p)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),x(s.$$.fragment),this.h()},l(d){F(e.$$.fragment,d),t=T(d),n=D(d,"DIV",{class:!0});var b=B(n);l=D(b,"DIV",{class:!0});var y=B(l);F(s.$$.fragment,y),y.forEach(g),b.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(d,b){C(e,d,b),S(d,t,b),S(d,n,b),v(n,l),C(s,l,null),f=!0},p(d,b){const y={};!i&&b&32&&(i=!0,y.saveButton=d[5],J(()=>i=!1)),e.$set(y);const h={};b&4&&(h.beneficiaryInfo=d[2]),b&2&&(h.beneficiaryId=d[1]),b&16&&(h.heading="Person "+(d[4]+1)),b&64&&(h.formErrors=d[6]),!o&&b&1&&(o=!0,h.beneficiaryInfoPayload=d[0],J(()=>o=!1)),!a&&b&8&&(a=!0,h.disableSaveBeneficiaryInfo=d[3],J(()=>a=!1)),s.$set(h)},i(d){f||(w(e.$$.fragment,d),w(s.$$.fragment,d),f=!0)},o(d){$(e.$$.fragment,d),$(s.$$.fragment,d),f=!1},d(d){d&&(g(t),g(n)),A(e,d),A(s)}}}function ma(r){let e,i,t=r[2]&&Ns(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[2]?t?(t.p(n,l),l&4&&w(t,1)):(t=Ns(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function ga(r,e,i){let t;U(r,He,k=>i(9,t=k));
1let{beneficiaryId:n,beneficiaryInfoPayload:l={}}=e,s,o=!1,a=0,f,c=[],u=[];const m=async()=>{var k;try{ce(f,!0),await He.updateBeneficiary(s.id,{beneficiarable_type:"Beneficiary::ExcludedPerson",beneficiarable_attributes:{id:s.beneficiarable_id,...l}})}catch(L){console.error(L),L instanceof mt&&(k=L.response)!=null&&k.data.data&&(i(6,u=L.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(f,!1)}},p=()=>{Fe("excluded-people-summary")},_=k=>{if(c.length){const L=c.find(E=>E.id===k);i(2,s=L?JSON.parse(JSON.stringify(L)):null),i(4,a=c.map(E=>E.id).indexOf(k))}},d=k=>{c=Re(["Beneficiary::ExcludedPerson"],k),n&&_(n)};function b(k){f=k,i(5,f)}function y(k){l=k,i(0,l)}function h(k){o=k,i(3,o)}return r.$$set=k=>{"beneficiaryId"in k&&i(1,n=k.beneficiaryId),"beneficiaryInfoPayload"in k&&i(0,l=k.beneficiaryInfoPayload)},r.$$.update=()=>{r.$$.dirty&2&&_(n),r.$$.dirty&512&&d(t)},[l,n,s,o,a,f,u,m,p,t,b,y,h]}class ya extends ae{constructor(e){super(),oe(this,e,ga,ma,le,{beneficiaryId:1,beneficiaryInfoPayload:0})}}function Hs(r){let e,i,t,n;const l=[wa,va],s=[];function o(a,f){return a[2]==="Beneficiary::Person"?0:1}return e=o(r),i=s[e]=l[e](r),{c(){i.c(),t=H()},l(a){i.l(a),t=H()},m(a,f){s[e].m(a,f),S(a,t,f),n=!0},p(a,f){let c=e;e=o(a),e===c?s[e].p(a,f):(q(),$(s[c],1,1,()=>{s[c]=null}),Y(),i=s[e],i?i.p(a,f):(i=s[e]=l[e](a),i.c()),w(i,1),i.m(t.parentNode,t))},i(a){n||(w(i),n=!0)},o(a){$(i),n=!1},d(a){a&&g(t),s[e].d(a)}}}function va(r){let e,i,t,n;function l(a){r[15](a)}function s(a){r[16](a)}let o={beneficiaryInfo:null,kind:"charity",formErrors:r[4]};return r[0]!==void 0&&(o.beneficiaryInfoPayload=r[0]),r[1]!==void 0&&(o.disableSaveBeneficiaryInfo=r[1]),e=new Zi({props:o}),j.push(()=>O(e,"beneficiaryInfoPayload",l)),j.push(()=>O(e,"disableSaveBeneficiaryInfo",s)),{c(){x(e.$$.fragment)},l(a){F(e.$$.fragment,a)},m(a,f){C(e,a,f),n=!0},p(a,f){const c={};f&16&&(c.formErrors=a[4]),!i&&f&1&&(i=!0,c.beneficiaryInfoPayload=a[0],J(()=>i=!1)),!t&&f&2&&(t=!0,c.disableSaveBeneficiaryInfo=a[1],J(()=>t=!1)),e.$set(c)},i(a){n||(w(e.$$.fragment,a),n=!0)},o(a){$(e.$$.fragment,a),n=!1},d(a){A(e,a)}}}function wa(r){let e,i,t,n;function l(a){r[13](a)}function s(a){r[14](a)}let o={beneficiaryInfo:null,kind:"other",formErrors:r[4]};return r[0]!==void 0&&(o.beneficiaryInfoPayload=r[0]),r[1]!==void 0&&(o.disableSaveBeneficiaryInfo=r[1]),e=new Xi({props:o}),j.push(()=>O(e,"beneficiaryInfoPayload",l)),j.push(()=>O(e,"disableSaveBeneficiaryInfo",s)),{c(){x(e.$$.fragment)},l(a){F(e.$$.fragment,a)},m(a,f){C(e,a,f),n=!0},p(a,f){const c={};f&16&&(c.formErrors=a[4]),!i&&f&1&&(i=!0,c.beneficiaryInfoPayload=a[0],J(()=>i=!1)),!t&&f&2&&(t=!0,c.disableSaveBeneficiaryInfo=a[1],J(()=>t=!1)),e.$set(c)},i(a){n||(w(e.$$.fragment,a),n=!0)},o(a){$(e.$$.fragment,a),n=!1},d(a){A(e,a)}}}function $a(r){let e,i,t,n,l,s,o,a,f,c;function u(b){r[11](b)}let m={onBack:r[9],onSave:r[8],heading:"Add Beneficiary"};r[3]!==void 0&&(m.saveButton=r[3]),e=new Ye({props:m}),j.push(()=>O(e,"saveButton",u));function p(b){r[12](b)}let _={name:"Account Type",options:r[6],required:!0,label:"Beneficiary Type",onChangeFunction:r[7]};r[2]!==void 0&&(_.group=r[2]),o=new hr({props:_}),j.push(()=>O(o,"group",p));let d=r[5]&&Hs(r);return{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("div"),x(o.$$.fragment),f=V(),d&&d.c(),this.h()},l(b){F(e.$$.fragment,b),t=T(b),n=D(b,"DIV",{class:!0});var y=B(n);l=D(y,"DIV",{class:!0});var h=B(l);s=D(h,"DIV",{class:!0});var k=B(s);F(o.$$.fragment,k),k.forEach(g),f=T(h),d&&d.l(h),h.forEach(g),y.forEac
1h(g),this.h()},h(){I(s,"class","-mb-1"),I(l,"class","flex flex-col mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(b,y){C(e,b,y),S(b,t,y),S(b,n,y),v(n,l),v(l,s),C(o,s,null),v(l,f),d&&d.m(l,null),c=!0},p(b,[y]){const h={};!i&&y&8&&(i=!0,h.saveButton=b[3],J(()=>i=!1)),e.$set(h);const k={};!a&&y&4&&(a=!0,k.group=b[2],J(()=>a=!1)),o.$set(k),b[5]?d?(d.p(b,y),y&32&&w(d,1)):(d=Hs(b),d.c(),w(d,1),d.m(l,null)):d&&(q(),$(d,1,1,()=>{d=null}),Y())},i(b){c||(w(e.$$.fragment,b),w(o.$$.fragment,b),w(d),c=!0)},o(b){$(e.$$.fragment,b),$(o.$$.fragment,b),$(d),c=!1},d(b){b&&(g(t),g(n)),A(e,b),A(o),d&&d.d()}}}function Ia(r,e,i){let t,n;U(r,xt,N=>i(18,t=N)),U(r,Ze,N=>i(19,n=N));let{beneficiaryId:l,beneficiaryInfoPayload:s={}}=e,o=!1;const a=n.params.id,f=[{identifier:"Beneficiary::Person",title:"Person"},{identifier:"Beneficiary::Charity",title:"Charity"}];let c="Beneficiary::Person",u,m=[],p=null,_=!0;const d=()=>{i(5,_=!1),setTimeout(()=>{i(5,_=!0)},100)},b=async()=>{var N;try{i(4,m=[]),ce(u,!0),p||(p=await He.addBeneficiary({beneficiarable_type:c,beneficiarable_attributes:{}},(t==null?void 0:t.customer_id)||"",a||"")),p&&await He.updateBeneficiary(p.id,{beneficiarable_type:c,beneficiarable_attributes:{id:p.beneficiarable_id,...s}}),Fe("people-and-charities-summary")}catch(z){console.error(z),z instanceof mt&&(N=z.response)!=null&&N.data.data&&(i(4,m=z.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(u,!1)}},y=()=>{Fe("people-and-charities-summary")};function h(N){u=N,i(3,u)}function k(N){c=N,i(2,c)}function L(N){s=N,i(0,s)}function E(N){o=N,i(1,o)}function W(N){s=N,i(0,s)}function M(N){o=N,i(1,o)}return r.$$set=N=>{"beneficiaryId"in N&&i(10,l=N.beneficiaryId),"beneficiaryInfoPayload"in N&&i(0,s=N.beneficiaryInfoPayload)},[s,o,c,u,m,_,f,d,b,y,l,h,k,L,E,W,M]}class ka extends ae{constructor(e){super(),oe(this,e,Ia,$a,le,{beneficiaryId:10,beneficiaryInfoPayload:0})}}function Pa(r){let e,i,t,n,l,s,o,a,f;function c(d){r[8](d)}let u={onBack:r[7],onSave:r[6],heading:"Add Pet"};r[3]!==void 0&&(u.saveButton=r[3]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(d){r[9](d)}function p(d){r[10](d)}let _={beneficiaryInfo:null,showHeading:!1,beneficiaryId:r[1],formErrors:r[4],willId:r[5]};return r[0]!==void 0&&(_.beneficiaryInfoPayload=r[0]),r[2]!==void 0&&(_.disableSaveBeneficiaryInfo=r[2]),s=new cn({props:_}),j.push(()=>O(s,"beneficiaryInfoPayload",m)),j.push(()=>O(s,"disableSaveBeneficiaryInfo",p)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),x(s.$$.fragment),this.h()},l(d){F(e.$$.fragment,d),t=T(d),n=D(d,"DIV",{class:!0});var b=B(n);l=D(b,"DIV",{class:!0});var y=B(l);F(s.$$.fragment,y),y.forEach(g),b.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(d,b){C(e,d,b),S(d,t,b),S(d,n,b),v(n,l),C(s,l,null),f=!0},p(d,[b]){const y={};!i&&b&8&&(i=!0,y.saveButton=d[3],J(()=>i=!1)),e.$set(y);const h={};b&2&&(h.beneficiaryId=d[1]),b&16&&(h.formErrors=d[4]),!o&&b&1&&(o=!0,h.beneficiaryInfoPayload=d[0],J(()=>o=!1)),!a&&b&4&&(a=!0,h.disableSaveBeneficiaryInfo=d[2],J(()=>a=!1)),s.$set(h)},i(d){f||(w(e.$$.fragment,d),w(s.$$.fragment,d),f=!0)},o(d){$(e.$$.fragment,d),$(s.$$.fragment,d),f=!1},d(d){d&&(g(t),g(n)),A(e,d),A(s)}}}function Da(r,e,i){let t,n;U(r,xt,h=>i(12,t=h)),U(r,Ze,h=>i(13,n=h));let{beneficiaryId:l,beneficiaryInfoPayload:s={}}=e,o,a=null,f=!1,c,u=[];const m=n.params.id,p=async()=>{var h;try{ce(c,!0),!o&&!a&&(a=await He.addBeneficiary({beneficiarable_type:"Beneficiary::Pet",beneficiarable_attributes:{}},(t==null?void 0:t.customer_id)||"",m||"")),a&&await He.updateBeneficiary(a.id,{beneficiarable_type:"Beneficiary::Pet",beneficiarable_attributes:{id:a.beneficiarable_id,...s}}),Fe("pets-summary")}catch(k){console.error(k),k instanceof mt&&(h=k.response)!=null&&h.data.data&&(i(4,u=k.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(c,!1)}},_=()=>{Fe("pets-summary")};function d(h){c=h,i(3,c)}function b(h){s=h,i(0,s)}function y(h){f=h,i(2,f)}return r.$$set=h=>
1{"beneficiaryId"in h&&i(1,l=h.beneficiaryId),"beneficiaryInfoPayload"in h&&i(0,s=h.beneficiaryInfoPayload)},[s,l,f,c,u,m,p,_,d,b,y]}class Ba extends ae{constructor(e){super(),oe(this,e,Da,Pa,le,{beneficiaryId:1,beneficiaryInfoPayload:0})}}function Sa(r){let e,i,t,n,l,s,o,a,f;function c(d){r[7](d)}let u={onBack:r[6],onSave:r[5],heading:"Add Excluded Person"};r[3]!==void 0&&(u.saveButton=r[3]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(d){r[8](d)}function p(d){r[9](d)}let _={beneficiaryInfo:null,showHeading:!1,beneficiaryId:r[1],formErrors:r[4]};return r[0]!==void 0&&(_.beneficiaryInfoPayload=r[0]),r[2]!==void 0&&(_.disableSaveBeneficiaryInfo=r[2]),s=new un({props:_}),j.push(()=>O(s,"beneficiaryInfoPayload",m)),j.push(()=>O(s,"disableSaveBeneficiaryInfo",p)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),x(s.$$.fragment),this.h()},l(d){F(e.$$.fragment,d),t=T(d),n=D(d,"DIV",{class:!0});var b=B(n);l=D(b,"DIV",{class:!0});var y=B(l);F(s.$$.fragment,y),y.forEach(g),b.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(d,b){C(e,d,b),S(d,t,b),S(d,n,b),v(n,l),C(s,l,null),f=!0},p(d,[b]){const y={};!i&&b&8&&(i=!0,y.saveButton=d[3],J(()=>i=!1)),e.$set(y);const h={};b&2&&(h.beneficiaryId=d[1]),b&16&&(h.formErrors=d[4]),!o&&b&1&&(o=!0,h.beneficiaryInfoPayload=d[0],J(()=>o=!1)),!a&&b&4&&(a=!0,h.disableSaveBeneficiaryInfo=d[2],J(()=>a=!1)),s.$set(h)},i(d){f||(w(e.$$.fragment,d),w(s.$$.fragment,d),f=!0)},o(d){$(e.$$.fragment,d),$(s.$$.fragment,d),f=!1},d(d){d&&(g(t),g(n)),A(e,d),A(s)}}}function Ea(r,e,i){let t,n;U(r,xt,h=>i(11,t=h)),U(r,Ze,h=>i(12,n=h));let{beneficiaryId:l,beneficiaryInfoPayload:s={}}=e,o,a=null,f=!1,c,u=[];const m=n.params.id,p=async()=>{var h;try{ce(c,!0),!o&&!a&&(a=await He.addBeneficiary({beneficiarable_type:"Beneficiary::ExcludedPerson",beneficiarable_attributes:{}},(t==null?void 0:t.customer_id)||"",m||"")),a&&await He.updateBeneficiary(a.id,{beneficiarable_type:"Beneficiary::ExcludedPerson",beneficiarable_attributes:{id:a.beneficiarable_id,...s}}),Fe("excluded-people-summary")}catch(k){console.error(k),k instanceof mt&&(h=k.response)!=null&&h.data.data&&(i(4,u=k.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(c,!1)}},_=()=>{Fe("excluded-people-summary")};function d(h){c=h,i(3,c)}function b(h){s=h,i(0,s)}function y(h){f=h,i(2,f)}return r.$$set=h=>{"beneficiaryId"in h&&i(1,l=h.beneficiaryId),"beneficiaryInfoPayload"in h&&i(0,s=h.beneficiaryInfoPayload)},[s,l,f,c,u,p,_,d,b,y]}class xa extends ae{constructor(e){super(),oe(this,e,Ea,Sa,le,{beneficiaryId:1,beneficiaryInfoPayload:0})}}function Ms(r){let e,i,t,n;function l(a){r[4](a)}var s=r[1].component;function o(a,f){let c={beneficiaryId:a[2]};return a[0]!==void 0&&(c.beneficiaryInfoPayload=a[0]),{props:c}}return s&&(e=qe(s,o(r)),j.push(()=>O(e,"beneficiaryInfoPayload",l))),{c(){e&&x(e.$$.fragment),t=H()},l(a){e&&F(e.$$.fragment,a),t=H()},m(a,f){e&&C(e,a,f),S(a,t,f),n=!0},p(a,f){if(f&2&&s!==(s=a[1].component)){if(e){q();const c=e;$(c.$$.fragment,1,0,()=>{A(c,1)}),Y()}s?(e=qe(s,o(a)),j.push(()=>O(e,"beneficiaryInfoPayload",l)),x(e.$$.fragment),w(e.$$.fragment,1),C(e,t.parentNode,t)):e=null}else if(s){const c={};f&4&&(c.beneficiaryId=a[2]),!i&&f&1&&(i=!0,c.beneficiaryInfoPayload=a[0],J(()=>i=!1)),e.$set(c)}},i(a){n||(e&&w(e.$$.fragment,a),n=!0)},o(a){e&&$(e.$$.fragment,a),n=!1},d(a){a&&g(t),e&&A(e,a)}}}function Ca(r){let e,i,t=r[1]&&Ms(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[1]?t?(t.p(n,l),l&2&&w(t,1)):(t=Ms(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function Aa(r,e,i){let t;U(r,Ze,m=>i(3,t=m));let{currentFormPayload:n}=e,l,s=null;const o=[{id:"people-and-charities-summary",component:ia},{id:"edit-people-charity-details",component:_a},{id:"add-people-charity-details",component:ka},{id:"pets-summary",component:ra},{id:"edit-pet-details",component:ha},{id:"add-pet-details",component:Ba},{id:"excluded-people-summary",component:oa}
1,{id:"edit-excluded-person-details",component:ya},{id:"add-excluded-person-details",component:xa}],a=()=>{i(1,l=o[0])},f=m=>{if(m){const p=m;try{jr.parse(p),i(1,l=o.find(_=>_.id===p)),i(1,l)}catch(_){a(),console.error("will-preview::beneficiaries-step::invalid-beneficiaries-step-error ",_)}}else t.url.searchParams.has("step")&&t.url.searchParams.get("step")==="beneficiaries"&&a()},c=m=>{i(2,s=m)};function u(m){n=m,i(0,n)}return r.$$set=m=>{"currentFormPayload"in m&&i(0,n=m.currentFormPayload)},r.$$.update=()=>{r.$$.dirty&8&&f(t.url.searchParams.get("beneficiaries-step")),r.$$.dirty&8&&c(t.url.searchParams.get("beneficiaries-id"))},[n,l,s,t,u]}class La extends ae{constructor(e){super(),oe(this,e,Aa,Ca,le,{currentFormPayload:0})}}function Ws(r,e,i){const t=r.slice();return t[9]=e[i],t}function js(r,e,i){const t=r.slice();return t[12]=e[i],t[14]=i,t}function Va(r){var t;let e,i;return e=new cr({props:{heading:"Estate",distributionItems:(t=r[0].data)==null?void 0:t.wishable.wish_percentage_distribution_items,onEditFunction:r[6]}}),{c(){x(e.$$.fragment)},l(n){F(e.$$.fragment,n)},m(n,l){C(e,n,l),i=!0},p(n,l){var o;const s={};l&1&&(s.distributionItems=(o=n[0].data)==null?void 0:o.wishable.wish_percentage_distribution_items),e.$set(s)},i(n){i||(w(e.$$.fragment,n),i=!0)},o(n){$(e.$$.fragment,n),i=!1},d(n){A(e,n)}}}function Ta(r){let e=[],i=new Map,t,n,l=ie(ci);const s=o=>o[9];for(let o=0;o<l.length;o+=1){let a=Ws(r,l,o),f=s(a);i.set(f,e[o]=Js(f,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();t=H()},l(o){for(let a=0;a<e.length;a+=1)e[a].l(o);t=H()},m(o,a){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(o,a);S(o,t,a),n=!0},p(o,a){a&22&&(l=ie(ci),q(),e=We(e,a,s,1,o,l,i,t.parentNode,Lt,Js,t,Ws),Y())},i(o){if(!n){for(let a=0;a<l.length;a+=1)w(e[a]);n=!0}},o(o){for(let a=0;a<e.length;a+=1)$(e[a]);n=!1},d(o){o&&g(t);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function Fa(r){var t;let e,i;return e=new ur({props:{heading:"Estate",distributionData:(t=r[0].data)==null?void 0:t.wishable,onEditFunction:r[5]}}),{c(){x(e.$$.fragment)},l(n){F(e.$$.fragment,n)},m(n,l){C(e,n,l),i=!0},p(n,l){var o;const s={};l&1&&(s.distributionData=(o=n[0].data)==null?void 0:o.wishable),e.$set(s)},i(n){i||(w(e.$$.fragment,n),i=!0)},o(n){$(e.$$.fragment,n),i=!1},d(n){A(e,n)}}}function Os(r){let e=[],i=new Map,t,n,l=ie(Qt(r[9],r[2]));const s=o=>o[12].id;for(let o=0;o<l.length;o+=1){let a=js(r,l,o),f=s(a);i.set(f,e[o]=Rs(f,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();t=H()},l(o){for(let a=0;a<e.length;a+=1)e[a].l(o);t=H()},m(o,a){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(o,a);S(o,t,a),n=!0},p(o,a){a&20&&(l=ie(Qt(o[9],o[2])),q(),e=We(e,a,s,1,o,l,i,t.parentNode,Lt,Rs,t,js),Y())},i(o){if(!n){for(let a=0;a<l.length;a+=1)w(e[a]);n=!0}},o(o){for(let a=0;a<e.length;a+=1)$(e[a]);n=!1},d(o){o&&g(t);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function zs(r){let e,i;return e=new Or({props:{assetItem:r[12],assetIndex:r[14]}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&4&&(l.assetItem=t[12]),n&4&&(l.assetIndex=t[14]),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Rs(r,e){let i,t=e[4](e[12].will_items[0].id),n,l,s=t&&zs(e);return{key:r,first:null,c(){i=H(),s&&s.c(),n=H(),this.h()},l(o){i=H(),s&&s.l(o),n=H(),this.h()},h(){this.first=i},m(o,a){S(o,i,a),s&&s.m(o,a),S(o,n,a),l=!0},p(o,a){e=o,a&4&&(t=e[4](e[12].will_items[0].id)),t?s?(s.p(e,a),a&4&&w(s,1)):(s=zs(e),s.c(),w(s,1),s.m(n.parentNode,n)):s&&(q(),$(s,1,1,()=>{s=null}),Y())},i(o){l||(w(s),l=!0)},o(o){$(s),l=!1},d(o){o&&(g(i),g(n)),s&&s.d(o)}}}function Js(r,e){let i,t,n,l=e[1].selected_asset_types&&e[1].selected_asset_types[ti[e[9]]]&&Os(e);return{key:r,first:null,c(){i=H(),l&&l.c(),t=H(),this.h()},l(s){i=H(),l&&l.l(s),t=H(),this.h()},h(){this.first=i},m(s,o){S(s,i,o),l&&l.m(s,o),S(s,t,o),n=!0},p(s,o){e=s,e[1].selected_asset_types&&e[1].selected_asset_types[ti[e[9]]]?l?(l.p(e,o),o&2&&w(l,1)):(l=Os(e),l.c(),w(l,1),l.m(t.parentNode,t)):l&&(q(),$(l,1,1,()=>{l=null}),Y())},i(s){n||(w(l),n=!0)},o(s){$(l),n=!1},d(s){s&&(g(i),g(t)),l&&l.d(s)}}}function Na(r){var t;let e,i;return e=new cr({props:{heading:"Residuary Estate",distributionItems:(t=r[3].data)==null?void 0:t.wishable.wish_percentage_distribution_items,onEditFunction:r[8]}}),{c(){x(e.$$.fragment)},l(n){F(e.$$.fragment,n)},m(n,l){C(e,n,l),i=!0},p(n,l){var o;const s={};l&8&&(s.distributionItems=(o=n[3].data)==null?void 0:o.wishable.wish_percentage_distribution_items),e.$set(s)},i(n){i||(w(e.$$.fragment,n),i=!0)},o(n){$(e.$$.fragment,n),i=!1},d(n){A(e,n)}}}function Ha(r){var t;let e,i;return e=new ur({props:{heading:"Residuary Estate",distributionData:(t=r[3].data)==null?void 0:t.wishable,onEditFunction:r[7]}}),{c(){x(e.$$.fragment)},l(n){F(e.$$.fragment,n)},m(n,l){C(e,n,l),i=!0},p(n,l){var o;const s={};l&8&&(s.distributionData=(o=n[3].data)==null?void 0:o.wishable),e.$set(s)},i(n){i||(w(e.$$.fragment,n),i=!0)},o(n){$(e.$$.fragment,n),i=!1},d(n){A(e,n)}}}function Ma(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Asset Distribution</p>',t,n,l,s,o,a,f,c,u;const m=[Fa,Ta,Va],p=[];function _(h,k){return h[0].type&&h[0].type==="Wish::Distribution::SingleBeneficiaryHandover"?0:h[0].type&&h[0].type==="Wish::Distribution::IndividualAssetDistribution"?1:h[0].type&&h[0].type==="Wish::Distribution::PercentageDistribution"?2:-1}~(s=_(r))&&(o=p[s]=m[s](r));const d=[Ha,Na],b=[];function y(h,k){return h[3].type&&h[3].type==="Wish::Distribution::SingleBeneficiaryHandover"?0:h[3].type&&h[3].type==="Wish::Distribution::PercentageDistribution"?1:-1}return~(f=y(r))&&(c=b[f]=d[f](r)),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),l=P("div"),o&&o.c(),a=V(),c&&c.c(),this.h()},l(h){e=D(h,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-zawnzo"&&(e.innerHTML=i),t=T(h),n=D(h,"DIV",{class:!0});var k=B(n);l=D(k,"DIV",{class:!0});var L=B(l);
1o&&o.l(L),a=T(L),c&&c.l(L),L.forEach(g),k.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(h,k){S(h,e,k),S(h,t,k),S(h,n,k),v(n,l),~s&&p[s].m(l,null),v(l,a),~f&&b[f].m(l,null),u=!0},p(h,[k]){let L=s;s=_(h),s===L?~s&&p[s].p(h,k):(o&&(q(),$(p[L],1,1,()=>{p[L]=null}),Y()),~s?(o=p[s],o?o.p(h,k):(o=p[s]=m[s](h),o.c()),w(o,1),o.m(l,a)):o=null);let E=f;f=y(h),f===E?~f&&b[f].p(h,k):(c&&(q(),$(b[E],1,1,()=>{b[E]=null}),Y()),~f?(c=b[f],c?c.p(h,k):(c=b[f]=d[f](h),c.c()),w(c,1),c.m(l,null)):c=null)},i(h){u||(w(o),w(c),u=!0)},o(h){$(o),$(c),u=!1},d(h){h&&(g(e),g(t),g(n)),~s&&p[s].d(),~f&&b[f].d()}}}function Wa(r,e,i){let t,n,l,s;return U(r,ui,m=>i(0,t=m)),U(r,Ht,m=>i(1,n=m)),U(r,Et,m=>i(2,l=m)),U(r,vi,m=>i(3,s=m)),[t,n,l,s,m=>t.data.wishable.wish_individual_asset_distribution_items.filter(_=>_.will_item_asset_id===m).length>0,()=>Gi("add-first-beneficiary",null,!0),()=>Gi("percentage-asset-distribution",null,!0),()=>Gi("divide-residuary-estate",null,!0),()=>Gi("divide-residuary-estate",null,!0)]}class ja extends ae{constructor(e){super(),oe(this,e,Wa,Ma,le,{})}}function Oa(r){let e,i,t,n,l,s,o="Who will inherit all of your assets?",a,f,c,u;function m(b){r[4](b)}let p={onBack:r[3],onSave:r[2],heading:"Edit Asset Distribution"};r[0]!==void 0&&(p.saveButton=r[0]),e=new Ye({props:p}),j.push(()=>O(e,"saveButton",m));function _(b){r[5](b)}let d={};return r[1]!==void 0&&(d.selectedBeneficiary=r[1]),f=new dr({props:d}),j.push(()=>O(f,"selectedBeneficiary",_)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("p"),s.textContent=o,a=V(),x(f.$$.fragment),this.h()},l(b){F(e.$$.fragment,b),t=T(b),n=D(b,"DIV",{class:!0});var y=B(n);l=D(y,"DIV",{class:!0});var h=B(l);s=D(h,"P",{class:!0,"data-svelte-h":!0}),te(s)!=="svelte-1brcjnk"&&(s.textContent=o),a=T(h),F(f.$$.fragment,h),h.forEach(g),y.forEac
1h(g),this.h()},h(){I(s,"class","font-semibold text-xl text-dark_grey_text"),I(l,"class","flex flex-col mx-auto !w-[560px] pb-8"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(b,y){C(e,b,y),S(b,t,y),S(b,n,y),v(n,l),v(l,s),v(l,a),C(f,l,null),u=!0},p(b,[y]){const h={};!i&&y&1&&(i=!0,h.saveButton=b[0],J(()=>i=!1)),e.$set(h);const k={};!c&&y&2&&(c=!0,k.selectedBeneficiary=b[1],J(()=>c=!1)),f.$set(k)},i(b){u||(w(e.$$.fragment,b),w(f.$$.fragment,b),u=!0)},o(b){$(e.$$.fragment,b),$(f.$$.fragment,b),u=!1},d(b){b&&(g(t),g(n)),A(e,b),A(f)}}}function za(r,e,i){var c;let t;U(r,ui,u=>i(6,t=u));let n,l=((c=t.data)==null?void 0:c.wishable.primary_beneficiary_id)||"";const s=async()=>{try{ce(n,!0),t.data&&await ui.updateDistribution(t.data.id,{wishable_type:"Wish::Distribution::SingleBeneficiaryHandover",wishable_attributes:{id:t.data.wishable_id,primary_beneficiary_id:l,secondary_beneficiary_id:t.data.wishable.secondary_beneficiary_id||null,tertiary_beneficiary_id:t.data.wishable.tertiary_beneficiary_id||null}}),Ct("assets-distribution-summary")}catch(u){console.error(u)}finally{ce(n,!1)}},o=()=>{Ct("assets-distribution-summary")};$i(()=>{var u;i(1,l=((u=t.data)==null?void 0:u.wishable.primary_beneficiary_id)||"")});function a(u){n=u,i(0,n)}function f(u){l=u,i(1,l)}return[n,l,s,o,a,f]}class Ra extends ae{constructor(e){super(),oe(this,e,za,Oa,le,{})}}function Ja(r){let e,i,t,n,l,s,o="In what percentage and to whom, do you want to divide your assets amongst your beneficiaries?",a,f,c,u,m;function p(h){r[5](h)}let _={onBack:r[4],onSave:r[3],heading:"Edit Asset Distribution"};r[2]!==void 0&&(_.saveButton=r[2]),e=new Ye({props:_}),j.push(()=>O(e,"saveButton",p));function d(h){r[6](h)}function b(h){r[7](h)}let y={};return r[0]!==void 0&&(y.percentageDistributionData=r[0]),r[1]!==void 0&&(y.disableSavePercentageDistribution=r[1]),f=new dn({props:y}),j.push(()=>O(f,"percentageDistributionData",d)),j.push(()=>O(f,"disableSavePercentageDistribution",b)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("p"),s.textContent=o,a=V(),x(f.$$.fragment),this.h()},l(h){F(e.$$.fragment,h),t=T(h),n=D(h,"DIV",{class:!0});var k=B(n);l=D(k,"DIV",{class:!0});var L=B(l);s=D(L,"P",{class:!0,"data-svelte-h":!0}),te(s)!=="svelte-1rjaged"&&(s.textContent=o),a=T(L),F(f.$$.fragment,L),L.forEach(g),k.forEach(g),this.h()},h(){I(s,"class","font-semibold text-xl text-dark_grey_text"),I(l,"class","flex flex-col mx-auto !w-[560px] pb-8"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(h,k){C(e,h,k),S(h,t,k),S(h,n,k),v(n,l),v(l,s),v(l,a),C(f,l,null),m=!0},p(h,[k]){const L={};!i&&k&4&&(i=!0,L.saveButton=h[2],J(()=>i=!1)),e.$set(L);const E={};!c&&k&1&&(c=!0,E.percentageDistributionData=h[0],J(()=>c=!1)),!u&&k&2&&(u=!0,E.disableSavePercentageDistribution=h[1],J(()=>u=!1)),f.$set(E)},i(h){m||(w(e.$$.fragment,h),w(f.$$.fragment,h),m=!0)},o(h){$(e.$$.fragment,h),$(f.$$.fragment,h),m=!1},d(h){h&&(g(t),g(n)),A(e,h),A(f)}}}function qa(r,e,i){let t;U(r,ui,m=>i(8,t=m));let n={},l=!1,s;const o=async()=>{var m;try{ce(s,!0);const p=Qi(n,((m=t.data)==null?void 0:m.wishable.wish_percentage_distribution_items)||[]);p.length&&t.data&&await ui.updateDistribution(t.data.id,{wishable_type:"Wish::Distribution::PercentageDistribution",wishable_attributes:{id:t.data.wishable_id,wish_percentage_distribution_items_attributes:p}}),Ct("assets-distribution-summary")}catch(p){console.error(p)}finally{ce(s,!1)}},a=()=>{Ct("assets-distribution-summary")};$i(()=>{var m;(((m=t.data)==null?void 0:m.wishable.wish_percentage_distribution_items)||[]).length&&t.data.wishable.wish_percentage_distribution_items.forEach(p=>{p.percentage&&p.percentage>0&&i(0,n[p.will_item_beneficiary_id]=p.percentage,n)})});function f(m){s=m,i(2,s)}function c(m){n=m,i(0,n)}function u(m){l=m,i(1,l)}return[n,l,s,o,a,f,c,u]}let Ya=class extends ae{constructor(e){super(),oe(this,e,qa,Ja,le,{})}};function qs(r,e,i){const t=r.slice();return t[15]=e[i],t[17]=i,t}function Ys(r){let e,i,t,n,l,s,o,a,f,c=[],u=new Map,m,p,_,d,b;function y(N){r[9](N)}let h={onBack:r[7],onSave:r[6],heading:"Edit Asset Distribution"};r[5]!==void 0&&(h.saveButton=r[5]),e=new Ye({props:h}),j.push(()=>O(e,"saveButton",y)),o=new zr({props:{title:"Who will be inheriting "+(r[1]?"this asset":`these ${r[0].length} assets`)+"?",description:"",showInfoDescription:"",showInfoTitle:""}});let k=ie(r[4]);const L=N=>N[17];for(let N=0;N<k.length;N+=1){let z=qs(r,k,N),R=L(z);u.set(R,c[N]=Gs(R,z))}function E(N){r[10](N)}function W(N){r[11](N)}let M={};return r[2]!==void 0&&(M.percentageDistributionData=r[2]),r[3]!==void 0&&(M.disableSavePercentageDistribution=r[3]),p=new dn({props:M}),j.push(()=>O(p,"percentageDistributionData",E)),j.push(()=>O(p,"disableSavePercentageDistribution",W)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("div"),x(o.$$.fragment),a=V(),f=P("div");for(let N=0;N<c.length;N+=1)c[N].c();m=V(),x(p.$$.fragment),this.h()},l(N){F(e.$$.fragment,N),t=T(N),n=D(N,"DIV",{class:!0});var z=B(n);l=D(z,"DIV",{class:!0});var R=B(l);s=D(R,"DIV",{class:!0});var Z=B(s);F(o.$$.fragment,Z),a=T(Z),f=D(Z,"DIV",{class:!0});var G=B(f);for(let X=0;X<c.length;X+=1)c[X].l(G);G.forEach(g),m=T(Z),F(p.$$.fragment,Z),Z.forEach(g),R.forEach(g),z.forEach(g),this.h()},h(){I(f,"class","flex flex-col gap-y-6 mt-6"),I(s,"class","flex flex-col flex-auto"),I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(N,z){C(e,N,z),S(N,t,z),S(N,n,z),v(n,l),v(l,s),C(o,s,null),v(s,a),v(s,f);for(let R=0;R<c.length;R+=1)c[R]&&c[R].m(f,null);v(s,m),C(p,s,null),b=!0},p(N,z){const R={};!i&&z&32&&(i=!0,R.saveButton=N[5],J(()=>i=!1)),e.$set(R);const Z={};z&3&&(Z.title="Who will be inheriting "+(N[1]?"this asset":`these ${N[0].length} assets`)+"?"),o.$set(Z),z&272&&(k=ie(N[4]),c=We(c,z,L,1,N,k,u,f,si,Gs,null,qs));const G={};!_&&z&4&&(_=!0,G.percentageDistributionData=N[2],J(()=>_=!1)),!d&&z&8&&(d=!0,G.disableSavePercentageDistribution=N[3],J(()=>d=!1)),p.$set(G)},i(N){b||(w(e.$$.fragment,N),w(o.$$.fragment,N),w(p.$$.fragment,N),b=!0)},o(N){$(e.$$.fragment,N),$(o.$$.fragment,N),$(p.$$.fragment,N),b=!1},d(N){N&&(g(t),g(n)),A(e,N),A(o);for(let z=0;z<c.length;z+=1)c[z].d();A(p)}}}function Us(r){var _,d,b;let e,i,t=(((_=r[8](r[15]))==null?void 0:_.heading)||"")+"",n,l,s,o=(((d=r[8](r[15]))==null?void 0:d.line_1)||"")+"",a,f,c,u=(((b=r[8](r[15]))==null?void 0:b.line_2)||"")+"",m,p;return{c(){e=P("div"),i=P("p"),n=pe(t),l=V(),s=P("p"),a=pe(o),f=V(),c=P("p"),m=pe(u),p=V(),this.h()},l(y){e=D(y,"DIV",{class:!0});var h=B(e);i=D(h,"P",{class:!0});var k=B(i);
1n=be(k,t),k.forEach(g),l=T(h),s=D(h,"P",{class:!0});var L=B(s);a=be(L,o),L.forEach(g),f=T(h),c=D(h,"P",{class:!0});var E=B(c);m=be(E,u),E.forEach(g),p=T(h),h.forEach(g),this.h()},h(){I(i,"class","first-letter:capitalize text-dark_grey_text text-base font-semibold leading-6"),I(s,"class","first-letter:capitalize default-text-style lowercase"),I(c,"class","first-letter:capitalize default-text-style lowercase"),I(e,"class","block")},m(y,h){S(y,e,h),v(e,i),v(i,n),v(e,l),v(e,s),v(s,a),v(e,f),v(e,c),v(c,m),v(e,p)},p(y,h){var k,L,E;h&16&&t!==(t=(((k=y[8](y[15]))==null?void 0:k.heading)||"")+"")&&Be(n,t),h&16&&o!==(o=(((L=y[8](y[15]))==null?void 0:L.line_1)||"")+"")&&Be(a,o),h&16&&u!==(u=(((E=y[8](y[15]))==null?void 0:E.line_2)||"")+"")&&Be(m,u)},d(y){y&&g(e)}}}function Gs(r,e){let i,t=e[8](e[15]),n,l=t&&Us(e);return{key:r,first:null,c(){i=H(),l&&l.c(),n=H(),this.h()},l(s){i=H(),l&&l.l(s),n=H(),this.h()},h(){this.first=i},m(s,o){S(s,i,o),l&&l.m(s,o),S(s,n,o)},p(s,o){e=s,o&16&&(t=e[8](e[15])),t?l?l.p(e,o):(l=Us(e),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(s){s&&(g(i),g(n)),l&&l.d(s)}}}function Ua(r){let e,i,t=r[4]&&r[4].length&&Ys(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[4]&&n[4].length?t?(t.p(n,l),l&16&&w(t,1)):(t=Ys(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function Ga(r,e,i){let t,n;U(r,ui,h=>i(13,t=h)),U(r,Et,h=>i(14,n=h));let{selectedAssets:l,assetId:s=null}=e,o={},a=!1,f=[],c=[],u;const m=async()=>{try{ce(u,!0);let h=[];if(t.data){if(s){const L=t.data.wishable.wish_individual_asset_distribution_items.filter(W=>W.will_item_asset_id===s),E=Qi(o,L);E.forEach(W=>{var M;W.will_item_asset_id=s,W.wish_individual_asset_distribution_id=(M=t.data)==null?void 0:M.wishable_id}),h=[...h,...E]}else l.forEach(k=>{const L=Qi(o,[]);L.forEach(E=>{var W;E.will_item_asset_id=k,E.wish_individual_asset_distribution_id=(W=t.data)==null?void 0:W.wishable_id}),h=[...h,...L]});await ui.updateDistribution(t.data.id,{wishable_type:"Wish::Distribution::IndividualAssetDistribution",wishable_attributes:{id:t.data.wishable_id,wish_individual_asset_distribution_items_attributes:h}}),Ct("assets-distribution-summary")}}catch(h){console.error(h)}finally{ce(u,!1)}},p=()=>{Ct("assets-distribution-summary")},_=h=>{let k=null;return ci.forEach(L=>{const E=Qt(L,n);if(E){const W=E.map(M=>M.id).indexOf(h.id);W>=0&&(k=mr(h.assetable_type,h,W,h.assetable.type))}}),k};$i(()=>{if(i(2,o={}),s){const h=n.find(k=>k.will_items[0].id===s);h&&i(0,l=[h.will_items[0].id])}i(4,f=n.filter(h=>l.includes(h.will_items[0].id))),s&&f.length&&t.data&&(c=t.data.wishable.wish_individual_asset_distribution_items.filter(h=>h.will_item_asset_id===f[0].will_items[0].id),c.length&&c.forEach(h=>{h.percentage&&h.percentage>0&&i(2,o[h.will_item_beneficiary_id]=h.percentage,o)}))});function d(h){u=h,i(5,u)}function b(h){o=h,i(2,o)}function y(h){a=h,i(3,a)}return r.$$set=h=>{"selectedAssets"in h&&i(0,l=h.selectedAssets),"assetId"in h&&i(1,s=h.assetId)},[l,s,o,a,f,u,m,p,_,d,b,y]}class Ka extends ae{constructor(e){super(),oe(this,e,Ga,Ua,le,{selectedAssets:0,assetId:1})}}function Qa(r){let e,i,t,n,l,s,o="How would you like to distribute your residuary estate?",a,f,c,u,m;function p(h){r[5](h)}let _={onBack:r[4],onSave:r[3],heading:"Edit Residuary Estate Distribution"};r[2]!==void 0&&(_.saveButton=r[2]),e=new Ye({props:_}),j.push(()=>O(e,"saveButton",p));function d(h){r[6](h)}function b(h){r[7](h)}let y={};return r[0]!==void 0&&(y.percentageDistributionData=r[0]),r[1]!==void 0&&(y.disableSavePercentageDistribution=r[1]),f=new dn({props:y}),j.push(()=>O(f,"percentageDistributionData",d)),j.push(()=>O(f,"disableSavePercentageDistribution",b)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("p"),s.textContent=o,a=V(),x(f.$$.fragment),this.h()},l(h){F(e.$$.fragment,h),t=T(h),n=D(h,"DIV",{class:!0});var k=B(n);l=D(k,"DIV",{class:!0});var L=B(l);s=D(L,"P",{class:!0,"data-svelte-h":!0}),te(s)!=="svelte-1qopcss"&&(s.textContent=o),a=T(L),F(f.$$.fragment,L),L.forEac
1h(g),k.forEach(g),this.h()},h(){I(s,"class","font-semibold text-xl text-dark_grey_text"),I(l,"class","flex flex-col mx-auto !w-[560px] pb-8"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(h,k){C(e,h,k),S(h,t,k),S(h,n,k),v(n,l),v(l,s),v(l,a),C(f,l,null),m=!0},p(h,[k]){const L={};!i&&k&4&&(i=!0,L.saveButton=h[2],J(()=>i=!1)),e.$set(L);const E={};!c&&k&1&&(c=!0,E.percentageDistributionData=h[0],J(()=>c=!1)),!u&&k&2&&(u=!0,E.disableSavePercentageDistribution=h[1],J(()=>u=!1)),f.$set(E)},i(h){m||(w(e.$$.fragment,h),w(f.$$.fragment,h),m=!0)},o(h){$(e.$$.fragment,h),$(f.$$.fragment,h),m=!1},d(h){h&&(g(t),g(n)),A(e,h),A(f)}}}function Xa(r,e,i){let t;U(r,vi,m=>i(8,t=m));let n={},l=!1,s;const o=async()=>{var m;try{ce(s,!0);const p=Qi(n,((m=t.data)==null?void 0:m.wishable.wish_percentage_distribution_items)||[]);p.length&&t.data&&await vi.updateDistribution(t.data.id,{wishable_type:"Wish::Distribution::PercentageDistribution",wishable_attributes:{id:t.data.wishable_id,wish_percentage_distribution_items_attributes:p}}),Ct("assets-distribution-summary")}catch(p){console.error(p)}finally{ce(s,!1)}},a=()=>{Ct("assets-distribution-summary")};$i(()=>{var m;(((m=t.data)==null?void 0:m.wishable.wish_percentage_distribution_items)||[]).length&&t.data.wishable.wish_percentage_distribution_items.forEach(p=>{p.percentage&&p.percentage>0&&i(0,n[p.will_item_beneficiary_id]=p.percentage,n)})});function f(m){s=m,i(2,s)}function c(m){n=m,i(0,n)}function u(m){l=m,i(1,l)}return[n,l,s,o,a,f,c,u]}class Za extends ae{constructor(e){super(),oe(this,e,Xa,Qa,le,{})}}function Ks(r){let e,i,t,n,l,s,o="Who will be inheriting your entire residuary estate?",a,f,c,u;function m(b){r[4](b)}let p={onBack:r[3],onSave:r[2],heading:"Edit Residuary Estate Distribution"};r[1]!==void 0&&(p.saveButton=r[1]),e=new Ye({props:p}),j.push(()=>O(e,"saveButton",m));function _(b){r[5](b)}let d={};return r[0]!==void 0&&(d.selectedBeneficiary=r[0]),f=new dr({props:d}),j.push(()=>O(f,"selectedBeneficiary",_)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),s=P("p"),s.textContent=o,a=V(),x(f.$$.fragment),this.h()},l(b){F(e.$$.fragment,b),t=T(b),n=D(b,"DIV",{class:!0});var y=B(n);l=D(y,"DIV",{class:!0});var h=B(l);s=D(h,"P",{class:!0,"data-svelte-h":!0}),te(s)!=="svelte-om64bc"&&(s.textContent=o),a=T(h),F(f.$$.fragment,h),h.forEach(g),y.forEac
1h(g),this.h()},h(){I(s,"class","font-semibold text-xl text-dark_grey_text"),I(l,"class","flex flex-col mx-auto !w-[560px] pb-8"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(b,y){C(e,b,y),S(b,t,y),S(b,n,y),v(n,l),v(l,s),v(l,a),C(f,l,null),u=!0},p(b,y){const h={};!i&&y&2&&(i=!0,h.saveButton=b[1],J(()=>i=!1)),e.$set(h);const k={};!c&&y&1&&(c=!0,k.selectedBeneficiary=b[0],J(()=>c=!1)),f.$set(k)},i(b){u||(w(e.$$.fragment,b),w(f.$$.fragment,b),u=!0)},o(b){$(e.$$.fragment,b),$(f.$$.fragment,b),u=!1},d(b){b&&(g(t),g(n)),A(e,b),A(f)}}}function eo(r){let e,i,t=r[0]&&Ks(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[0]?t?(t.p(n,l),l&1&&w(t,1)):(t=Ks(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function to(r,e,i){var c;let t;U(r,vi,u=>i(6,t=u));let n=((c=t.data)==null?void 0:c.wishable.primary_beneficiary_id)||"",l;const s=async()=>{var u;try{ce(l,!0),t.data&&await vi.updateDistribution(t.data.id,{wishable_type:"Wish::Distribution::SingleBeneficiaryHandover",wishable_attributes:{id:(u=t.data)==null?void 0:u.wishable_id,primary_beneficiary_id:n,secondary_beneficiary_id:null,tertiary_beneficiary_id:null}}),Ct("assets-distribution-summary")}catch(m){console.error(m)}finally{ce(l,!1)}},o=()=>{Ct("assets-distribution-summary")};$i(()=>{i(0,n=t.data.wishable.primary_beneficiary_id||"")});function a(u){l=u,i(1,l)}function f(u){n=u,i(0,n)}return[n,l,s,o,a,f]}class io extends ae{constructor(e){super(),oe(this,e,to,eo,le,{})}}function no(r){let e,i;return e=new Za({}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function so(r){let e,i;return e=new io({}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function ro(r){let e,i,t,n;const l=[so,no],s=[];function o(a,f){return a[0]==="Wish::Distribution::SingleBeneficiaryHandover"?0:a[0]==="Wish::Distribution::PercentageDistribution"?1:-1}return~(e=o(r))&&(i=s[e]=l[e](r)),{c(){i&&i.c(),t=H()},l(a){i&&i.l(a),t=H()},m(a,f){~e&&s[e].m(a,f),S(a,t,f),n=!0},p:Me,i(a){n||(w(i),n=!0)},o(a){$(i),n=!1},d(a){a&&g(t),~e&&s[e].d(a)}}}function lo(r,e,i){let t;return U(r,vi,l=>i(1,t=l)),[t.type||"Wish::Distribution::SingleBeneficiaryHandover"]}class ao extends ae{constructor(e){super(),oe(this,e,lo,ro,le,{})}}function Qs(r){let e,i,t;var n=r[0].component;function l(s,o){return{props:{assetId:s[1],isEditing:s[2]}}}return n&&(e=qe(n,l(r))),{c(){e&&x(e.$$.fragment),i=H()},l(s){e&&F(e.$$.fragment,s),i=H()},m(s,o){e&&C(e,s,o),S(s,i,o),t=!0},p(s,o){if(o&1&&n!==(n=s[0].component)){if(e){q();const a=e;$(a.$$.fragment,1,0,()=>{A(a,1)}),Y()}n?(e=qe(n,l(s)),x(e.$$.fragment),w(e.$$.fragment,1),C(e,i.parentNode,i)):e=null}else if(n){const a={};
1o&2&&(a.assetId=s[1]),o&4&&(a.isEditing=s[2]),e.$set(a)}},i(s){t||(e&&w(e.$$.fragment,s),t=!0)},o(s){e&&$(e.$$.fragment,s),t=!1},d(s){s&&g(i),e&&A(e,s)}}}function oo(r){let e,i,t=r[0]&&Qs(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[0]?t?(t.p(n,l),l&1&&w(t,1)):(t=Qs(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function fo(r,e,i){let t;U(r,Ze,m=>i(3,t=m));let n,l=null,s=!0;const o=[{id:"assets-distribution-summary",component:ja},{id:"add-first-beneficiary",component:Ra},{id:"percentage-asset-distribution",component:Ya},{id:"assign-beneficiary-to-asset",component:Ka},{id:"divide-residuary-estate",component:ao}],a=()=>{i(0,n=o[0])},f=m=>{if(m){const p=m;try{Rr.parse(p),i(0,n=o.find(_=>_.id===p)),i(0,n)}catch(_){a(),console.error("will-preview::assets-distribution-step::invalid-assets-liabilities-step-step-error ",_)}}else t.url.searchParams.has("step")&&t.url.searchParams.get("step")==="asset-distribution"&&a()},c=m=>{i(1,l=m)},u=m=>{i(2,s=m!==null)};return r.$$.update=()=>{r.$$.dirty&8&&f(t.url.searchParams.get("asset-distribution-step")),r.$$.dirty&8&&c(t.url.searchParams.get("asset-id")),r.$$.dirty&8&&u(t.url.searchParams.get("is-editing"))},[n,l,s,t]}class co extends ae{constructor(e){super(),oe(this,e,fo,oo,le,{})}}function uo(r){let e,i,t,n="Will Preview",l,s,o,a,f,c="Download Document",u,m,p,_,d,b;o=new Le({props:{kind:"download"}});const y=r[2].default,h=sr(y,r,r[1],null);return{c(){e=P("div"),i=P("div"),t=P("p"),t.textContent=n,l=V(),s=P("div"),x(o.$$.fragment),a=V(),f=P("p"),f.textContent=c,u=V(),m=P("div"),p=P("div"),h&&h.c(),this.h()},l(k){e=D(k,"DIV",{class:!0});var L=B(e);i=D(L,"DIV",{class:!0});var E=B(i);t=D(E,"P",{class:!0,"data-svelte-h":!0}),te(t)!=="svelte-xri4dw"&&(t.textContent=n),l=T(E),s=D(E,"DIV",{class:!0});var W=B(s);F(o.$$.fragment,W),a=T(W),f=D(W,"P",{class:!0,"data-svelte-h":!0}),te(f)!=="svelte-te6rl2"&&(f.textContent=c),W.forEach(g),E.forEach(g),u=T(L),m=D(L,"DIV",{class:!0});var M=B(m);p=D(M,"DIV",{class:!0});var N=B(p);h&&h.l(N),N.forEach(g),M.forEach(g),L.forEach(g),this.h()},h(){I(t,"class","text-dark_grey_text text-[20px] font-semibold leading-7"),I(f,"class","text-aasaan_logo_blue font-regular"),I(s,"class","flex gap-1.5 cursor-pointer py-[6px] mt-1 mb-4"),I(i,"class",""),I(p,"class","pdf-preview-body"),I(m,"class","mt-0 overflow-y-auto overflow-x-hidden scroller pdf-preview-container"),I(e,"class","flex flex-col bg-transperant h-[calc(100dvh-220px)] mb-40 overflow-hidden")},m(k,L){S(k,e,L),v(e,i),v(i,t),v(i,l),v(i,s),C(o,s,null),v(s,a),v(s,f),v(e,u),v(e,m),v(m,p),h&&h.m(p,null),_=!0,d||(b=ge(s,"click",function(){rr(r[0])&&r[0].apply(this,arguments)}),d=!0)},p(k,[L]){r=k,h&&h.p&&(!_||L&2)&&lr(h,y,r,r[1],_?or(y,r[1],L,null):ar(r[1]),null)},i(k){_||(w(o.$$.fragment,k),w(h,k),_=!0)},o(k){$(o.$$.fragment,k),$(h,k),_=!1},d(k){k&&g(e),A(o),h&&h.d(k),d=!1,b()}}}function _o(r,e,i){let{$$slots:t={},$$scope:n}=e,{onDownloadClick:l}=e;return r.$$set=s=>{"onDownloadClick"in s&&i(0,l=s.onDownloadClick),"$$scope"in s&&i(1,n=s.$$scope)},[l,n,t]}class li extends ae{constructor(e){super(),oe(this,e,_o,uo,le,{onDownloadClick:0})}}function po(r){let e,i;return e=new li({props:{onDownloadClick:r[0],$$slots:{default:[mo]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&1&&(l.onDownloadClick=t[0]),n&68&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function bo(r){let e,i;return e=new li({props:{onDownloadClick:r[0],$$slots:{default:[go]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&1&&(l.onDownloadClick=t[0]),n&68&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function ho(r){let e,i;return e=new li({props:{onDownloadClick:r[0],$$slots:{default:[yo]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)}
1,m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&1&&(l.onDownloadClick=t[0]),n&68&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function mo(r){let e,i;return e=new kr({props:{groupedBeneficiaries:r[2]}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&4&&(l.groupedBeneficiaries=t[2]),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function go(r){let e,i;return e=new Pr({props:{groupedBeneficiaries:r[2]}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&4&&(l.groupedBeneficiaries=t[2]),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function yo(r){let e,i;return e=new Dr({props:{groupedBeneficiaries:r[2],isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&4&&(l.groupedBeneficiaries=t[2]),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function vo(r){let e,i,t,n;const l=[ho,bo,po],s=[];function o(a,f){return a[1]==="people & charity"?0:a[1]==="pets"?1:2}return e=o(r),i=s[e]=l[e](r),{c(){i.c(),t=H()},l(a){i.l(a),t=H()},m(a,f){s[e].m(a,f),S(a,t,f),n=!0},p(a,[f]){let c=e;e=o(a),e===c?s[e].p(a,f):(q(),$(s[c],1,1,()=>{s[c]=null}),Y(),i=s[e],i?i.p(a,f):(i=s[e]=l[e](a),i.c()),w(i,1),i.m(t.parentNode,t))},i(a){n||(w(i),n=!0)},o(a){$(i),n=!1},d(a){a&&g(t),s[e].d(a)}}}function wo(r,e,i){let t,n,l;U(r,Ze,f=>i(4,n=f)),U(r,mi,f=>i(5,l=f));let{onDownloadClick:s,isPreview:o=!1}=e,a="people & charity";return r.$$set=f=>{"onDownloadClick"in f&&i(0,s=f.onDownloadClick),"isPreview"in f&&i(3,o=f.isPreview)},r.$$.update=()=>{if(r.$$.dirty&32&&i(2,t=l.beneficiaries||{people:[],pets:[],excludedPeople:[]}),r.$$.dirty&16){const f=n.url.searchParams.get("beneficiaries-step");if(f){let c=f;c==="people-and-charities-summary"||c==="edit-people-charity-details"||c==="add-people-charity-details"?i(1,a="people & charity"):c==="pets-summary"||c==="edit-pet-details"||c==="add-pet-details"?i(1,a="pets"):i(1,a="excluded persons")}}},[s,a,t,o,n,l]}class $o extends ae{constructor(e){super(),oe(this,e,wo,vo,le,{onDownloadClick:0,isPreview:3})}}function Io(r){let e,i,t,n,l,s,o,a,f;const c=r[4].default,u=sr(c,r,r[3],null);return{c(){e=P("div"),i=P("div"),n=V(),l=P("div"),u&&u.c(),this.h()},l(m){e=D(m,"DIV",{class:!0});var p=B(e);i=D(p,"DIV",{class:!0}
1),B(i).forEach(g),n=T(p),l=D(p,"DIV",{class:!0});var _=B(l);u&&u.l(_),_.forEach(g),p.forEach(g),this.h()},h(){I(i,"class","fixed inset-0 z-50 bg-[#00000080]"),I(l,"class","hidden relative overflow-auto md:flex md:fixed z-[51] top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] items-top rounded-[20px] justify-center"),I(e,"class",r[0])},m(m,p){S(m,e,p),v(e,i),v(e,n),v(e,l),u&&u.m(l,null),o=!0,a||(f=ge(i,"click",Je(function(){rr(r[1])&&r[1].apply(this,arguments)})),a=!0)},p(m,[p]){r=m,u&&u.p&&(!o||p&8)&&lr(u,c,r,r[3],o?or(c,r[3],p,null):ar(r[3]),null),(!o||p&1)&&I(e,"class",r[0])},i(m){o||(m&&ni(()=>{o&&(t||(t=Yi(i,Ui,{duration:300},!0)),t.run(1))}),w(u,m),m&&ni(()=>{o&&(s||(s=Yi(l,Ui,{duration:300},!0)),s.run(1))}),o=!0)},o(m){m&&(t||(t=Yi(i,Ui,{duration:300},!1)),t.run(0)),$(u,m),m&&(s||(s=Yi(l,Ui,{duration:300},!1)),s.run(0)),o=!1},d(m){m&&g(e),m&&t&&t.end(),u&&u.d(m),m&&s&&s.end(),a=!1,f()}}}function ko(r,e,i){let{$$slots:t={},$$scope:n}=e,{isAlert:l=!1,classes:s="",close:o=()=>{}}=e;return r.$$set=a=>{"isAlert"in a&&i(2,l=a.isAlert),"classes"in a&&i(0,s=a.classes),"close"in a&&i(1,o=a.close),"$$scope"in a&&i(3,n=a.$$scope)},[s,o,l,n,t]}class Po extends ae{constructor(e){super(),oe(this,e,ko,Io,le,{isAlert:2,classes:0,close:1})}}function Xs(r,e,i){const t=r.slice();return t[6]=e[i],t[8]=i,t}function Zs(r){let e,i="No executors assigned";return{c(){e=P("h4"),e.textContent=i},l(t){e=D(t,"H4",{"data-svelte-h":!0}),te(e)!=="svelte-1ks8s6r"&&(e.textContent=i)},m(t,n){S(t,e,n)},d(t){t&&g(e)}}}function er(r,e){let i,t,n;return t=new Yr({props:{executorIndex:e[8],executorInfo:e[6],onEditFunction:e[1]}}),{key:r,first:null,c(){i=H(),x(t.$$.fragment),this.h()},l(l){i=H(),F(t.$$.fragment,l),this.h()},h(){this.first=i},m(l,s){S(l,i,s),C(t,l,s),n=!0},p(l,s){e=l;const o={};s&1&&(o.executorIndex=e[8]),s&1&&(o.executorInfo=e[6]),t.$set(o)},i(l){n||(w(t.$$.fragment,l),n=!0)},o(l){$(t.$$.fragment,l),n=!1},d(l){l&&g(i),A(t,l)}}}function Do(r){let e,i='<p class="text-dark_grey_text text-[20px] font-semibold leading-7">Will Executors</p>',t,n,l,s,o,a=[],f=new Map,c,u,m,p=!r[0].length&&Zs(),_=ie(r[0]);const d=b=>b[6].id;for(let b=0;b<_.length;b+=1){let y=Xs(r,_,b),h=d(y);f.set(h,a[b]=er(h,y))}return u=new ht({props:{type:"tertiary",text:"Add Person",icon:"plus",onClick:r[3],name:"add-beneficiary",iconClasses:"h-3 w-3 mr-[10px]",classes:"mx-auto !w-[560px] mt-5"}}),{c(){e=P("div"),e.innerHTML=i,t=V(),n=P("div"),p&&p.c(),l=V(),s=P("div"),o=P("div");for(let b=0;b<a.length;b+=1)a[b].c();c=V(),x(u.$$.fragment),this.h()},l(b){e=D(b,"DIV",{class:!0,"data-svelte-h":!0}),te(e)!=="svelte-x2er4g"&&(e.innerHTML=i),t=T(b),n=D(b,"DIV",{class:!0});var y=B(n);p&&p.l(y),l=T(y),s=D(y,"DIV",{class:!0});var h=B(s);o=D(h,"DIV",{class:!0});var k=B(o);for(let L=0;L<a.length;L+=1)a[L].l(k);
1k.forEach(g),h.forEach(g),c=T(y),F(u.$$.fragment,y),y.forEach(g),this.h()},h(){I(e,"class","sticky top-0 pb-[56px]"),I(o,"class","flex flex-col gap-y-6"),I(s,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-4"),I(n,"class","h-[calc(100dvh-300px)] overflow-y-auto pr-[44px] overflow-x-hidden scroller")},m(b,y){S(b,e,y),S(b,t,y),S(b,n,y),p&&p.m(n,null),v(n,l),v(n,s),v(s,o);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(o,null);v(n,c),C(u,n,null),m=!0},p(b,[y]){b[0].length?p&&(p.d(1),p=null):p||(p=Zs(),p.c(),p.m(n,l)),y&3&&(_=ie(b[0]),q(),a=We(a,y,d,1,b,_,f,o,Lt,er,null,Xs),Y())},i(b){if(!m){for(let y=0;y<_.length;y+=1)w(a[y]);w(u.$$.fragment,b),m=!0}},o(b){for(let y=0;y<a.length;y+=1)$(a[y]);$(u.$$.fragment,b),m=!1},d(b){b&&(g(e),g(t),g(n)),p&&p.d();for(let y=0;y<a.length;y+=1)a[y].d();A(u)}}}function Bo(r,e,i){let t,n;U(r,Ze,a=>i(4,t=a)),U(r,ii,a=>i(0,n=a)),t.params.id;const l=a=>{wi("edit-executor",a.id)},s=()=>{wi("add-executor")};return[n,l,s,()=>s()]}class So extends ae{constructor(e){super(),oe(this,e,Bo,Do,le,{})}}function tr(r){let e,i,t,n,l,s,o,a,f;function c(d){r[9](d)}let u={onBack:r[7],onSave:r[6],heading:"Edit Executor"};r[4]!==void 0&&(u.saveButton=r[4]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(d){r[10](d)}function p(d){r[11](d)}let _={executorInfo:r[1],formErrors:r[5],showHeading:!0,heading:"Executor "+(r[3]+1)};return r[0]!==void 0&&(_.executorInfoPayload=r[0]),r[2]!==void 0&&(_.disableSaveExecutorInfo=r[2]),s=new _r({props:_}),j.push(()=>O(s,"executorInfoPayload",m)),j.push(()=>O(s,"disableSaveExecutorInfo",p)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),x(s.$$.fragment),this.h()},l(d){F(e.$$.fragment,d),t=T(d),n=D(d,"DIV",{class:!0});var b=B(n);l=D(b,"DIV",{class:!0});var y=B(l);F(s.$$.fragment,y),y.forEach(g),b.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(d,b){C(e,d,b),S(d,t,b),S(d,n,b),v(n,l),C(s,l,null),f=!0},p(d,b){const y={};!i&&b&16&&(i=!0,y.saveButton=d[4],J(()=>i=!1)),e.$set(y);const h={};b&2&&(h.executorInfo=d[1]),b&32&&(h.formErrors=d[5]),b&8&&(h.heading="Executor "+(d[3]+1)),!o&&b&1&&(o=!0,h.executorInfoPayload=d[0],J(()=>o=!1)),!a&&b&4&&(a=!0,h.disableSaveExecutorInfo=d[2],J(()=>a=!1)),s.$set(h)},i(d){f||(w(e.$$.fragment,d),w(s.$$.fragment,d),f=!0)},o(d){$(e.$$.fragment,d),$(s.$$.fragment,d),f=!1},d(d){d&&(g(t),g(n)),A(e,d),A(s)}}}function Eo(r){let e,i,t=r[1]&&tr(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[1]?t?(t.p(n,l),l&2&&w(t,1)):(t=tr(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function xo(r,e,i){let t,n;U(r,ii,h=>i(12,t=h)),U(r,Ze,h=>i(13,n=h));let{executorId:l,executorInfoPayload:s={}}=e,o,a=!1,f=0,c,u=[];n.params.id;const m=async()=>{var h;try{ce(c,!0),await ii.updateExecutor(o.id,{executorable_type:"Executor::Custom",executorable_attributes:{id:o.executorable_id,...s}})}catch(k){console.error(k),k instanceof mt&&(h=k.response)!=null&&h.data.data&&(i(5,u=k.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(c,!1)}},p=()=>{wi("executors-summary")},_=h=>{h&&(i(1,o=t.find(k=>k.id===h)||null),i(3,f=t.map(k=>k.id).indexOf(h)))};function d(h){c=h,i(4,c)}function b(h){s=h,i(0,s)}function y(h){a=h,i(2,a)}return r.$$set=h=>{"executorId"in h&&i(8,l=h.executorId),"executorInfoPayload"in h&&i(0,s=h.executorInfoPayload)},r.$$.update=()=>{r.$$.dirty&256&&_(l)},[s,o,a,f,c,u,m,p,l,d,b,y]}class Co extends ae{constructor(e){super(),oe(this,e,xo,Eo,le,{executorId:8,executorInfoPayload:0})}}function Ao(r){let e,i,t,n,l,s,o,a,f;function c(d){r[7](d)}let u={onBack:r[5],onSave:r[4],heading:"Add Executor"};r[2]!==void 0&&(u.saveButton=r[2]),e=new Ye({props:u}),j.push(()=>O(e,"saveButton",c));function m(d){r[8](d)}function p(d){r[9](d)}let _={executorInfo:null,formErrors:r[3],showHeading:!1};return r[0]!==void 0&&(_.executorInfoPayload=r[0]),r[1]!==void 0&&(_.disableSaveExecutorInfo=r[1]),s=new _r({props:_}),j.push(()=>O(s,"executorInfoPayload",m)),j.push(()=>
1O(s,"disableSaveExecutorInfo",p)),{c(){x(e.$$.fragment),t=V(),n=P("div"),l=P("div"),x(s.$$.fragment),this.h()},l(d){F(e.$$.fragment,d),t=T(d),n=D(d,"DIV",{class:!0});var b=B(n);l=D(b,"DIV",{class:!0});var y=B(l);F(s.$$.fragment,y),y.forEach(g),b.forEach(g),this.h()},h(){I(l,"class","flex flex-col gap-y-9 mx-auto !w-[560px] pb-8 -mt-10"),I(n,"class","h-[calc(100dvh-298px)] overflow-y-auto pr-[44px] scroller overflow-x-hidden")},m(d,b){C(e,d,b),S(d,t,b),S(d,n,b),v(n,l),C(s,l,null),f=!0},p(d,[b]){const y={};!i&&b&4&&(i=!0,y.saveButton=d[2],J(()=>i=!1)),e.$set(y);const h={};b&8&&(h.formErrors=d[3]),!o&&b&1&&(o=!0,h.executorInfoPayload=d[0],J(()=>o=!1)),!a&&b&2&&(a=!0,h.disableSaveExecutorInfo=d[1],J(()=>a=!1)),s.$set(h)},i(d){f||(w(e.$$.fragment,d),w(s.$$.fragment,d),f=!0)},o(d){$(e.$$.fragment,d),$(s.$$.fragment,d),f=!1},d(d){d&&(g(t),g(n)),A(e,d),A(s)}}}function Lo(r,e,i){let t,n;U(r,xt,h=>i(11,t=h)),U(r,Ze,h=>i(12,n=h));let{executorId:l,executorInfoPayload:s={}}=e,o,a=null,f=!1,c,u=[];const m=n.params.id,p=async()=>{var h;try{i(3,u=[]),ce(c,!0),!o&&!a&&(a=await ii.addExecutor({executorable_type:"Executor::Custom",executorable_attributes:{}},t.customer_id,m)),a&&await ii.updateExecutor(a.id,{executorable_type:"Executor::Custom",executorable_attributes:{id:a.executorable_id,...s}}),wi("executors-summary")}catch(k){console.error(k),k instanceof mt&&(h=k.response)!=null&&h.data.data&&(i(3,u=k.response.data.data),setTimeout(()=>{At("error")},100))}finally{ce(c,!1)}},_=()=>{wi("executors-summary")};function d(h){c=h,i(2,c)}function b(h){s=h,i(0,s)}function y(h){f=h,i(1,f)}return r.$$set=h=>{"executorId"in h&&i(6,l=h.executorId),"executorInfoPayload"in h&&i(0,s=h.executorInfoPayload)},[s,f,c,u,p,_,l,d,b,y]}class Vo extends ae{constructor(e){super(),oe(this,e,Lo,Ao,le,{executorId:6,executorInfoPayload:0})}}function ir(r){let e,i,t,n;function l(a){r[4](a)}var s=r[1].component;function o(a,f){let c={executorId:a[2]};return a[0]!==void 0&&(c.executorInfoPayload=a[0]),{props:c}}return s&&(e=qe(s,o(r)),j.push(()=>O(e,"executorInfoPayload",l))),{c(){e&&x(e.$$.fragment),t=H()},l(a){e&&F(e.$$.fragment,a),t=H()},m(a,f){e&&C(e,a,f),S(a,t,f),n=!0},p(a,f){if(f&2&&s!==(s=a[1].component)){if(e){q();const c=e;$(c.$$.fragment,1,0,()=>{A(c,1)}),Y()}s?(e=qe(s,o(a)),j.push(()=>O(e,"executorInfoPayload",l)),x(e.$$.fragment),w(e.$$.fragment,1),C(e,t.parentNode,t)):e=null}else if(s){const c={};f&4&&(c.executorId=a[2]),!i&&f&1&&(i=!0,c.executorInfoPayload=a[0],J(()=>i=!1)),e.$set(c)}},i(a){n||(e&&w(e.$$.fragment,a),n=!0)},o(a){e&&$(e.$$.fragment,a),n=!1},d(a){a&&g(t),e&&A(e,a)}}}function To(r){let e,i,t=r[1]&&ir(r);return{c(){t&&t.c(),e=H()},l(n){t&&t.l(n),e=H()},m(n,l){t&&t.m(n,l),S(n,e,l),i=!0},p(n,[l]){n[1]?t?(t.p(n,l),l&2&&w(t,1)):(t=ir(n),t.c(),w(t,1),t.m(e.parentNode,e)):t&&(q(),$(t,1,1,()=>{t=null}),Y())},i(n){i||(w(t),i=!0)},o(n){$(t),i=!1},d(n){n&&g(e),t&&t.d(n)}}}function Fo(r,e,i){let t;U(r,Ze,m=>i(3,t=m));let{currentFormPayload:n}=e,l,s=null;const o=[{id:"executors-summary",component:So},{id:"edit-executor",component:Co},{id:"add-executor",component:Vo}],a=()=>{i(1,l=o[0])},f=m=>{if(m){const p=m;try{Jr.parse(p),i(1,l=o.find(_=>_.id===p)),i(1,l)}catch(_){a(),console.error("will-preview::executor-step::invalid-executor-step-error ",_)}}else t.url.searchParams.has("step")&&t.url.searchParams.get("step")==="executors"&&a()},c=m=>{i(2,s=m)};function u(m){n=m,i(0,n)}return r.$$set=m=>{"currentFormPayload"in m&&i(0,n=m.currentFormPayload)},r.$$.update=()=>{r.$$.dirty&8&&f(t.url.searchParams.get("executors-step")),r.$$.dirty&8&&c(t.url.searchParams.get("executor-id"))},[n,l,s,t,u]}class No extends ae{constructor(e){super(),oe(this,e,Fo,To,le,{currentFormPayload:0})}}function Ho(r){let e,i,t;function n(s){r[20](s)}let l={};return r[1]!==void 0&&(l.currentFormPayload=r[1]),e=new No({props:l}),j.push(()=>O(e,"currentFormPayload",n)),{c(){x(e.$$.fragment)},l(s){F(e.$$.fragment,s)},m(s,o){C(e,s,o),t=!0},p(s,o){const a={};!i&&o&2&&(i=!0,a.currentFormPayload=s[1],J(()=>i=!1)),e.$set(a)},i(s){t||(w(e.$$.fragment,s),t=!0)},o(s){$(e.$$.fragment,s),t=!1},d(s){A(e,s)}}}function Mo(r){let e,i;return e=new co({}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)}
1,m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Wo(r){let e,i,t;function n(s){r[19](s)}let l={};return r[1]!==void 0&&(l.currentFormPayload=r[1]),e=new La({props:l}),j.push(()=>O(e,"currentFormPayload",n)),{c(){x(e.$$.fragment)},l(s){F(e.$$.fragment,s)},m(s,o){C(e,s,o),t=!0},p(s,o){const a={};!i&&o&2&&(i=!0,a.currentFormPayload=s[1],J(()=>i=!1)),e.$set(a)},i(s){t||(w(e.$$.fragment,s),t=!0)},o(s){$(e.$$.fragment,s),t=!1},d(s){A(e,s)}}}function jo(r){let e,i,t;function n(s){r[18](s)}let l={};return r[1]!==void 0&&(l.currentFormPayload=r[1]),e=new Zl({props:l}),j.push(()=>O(e,"currentFormPayload",n)),{c(){x(e.$$.fragment)},l(s){F(e.$$.fragment,s)},m(s,o){C(e,s,o),t=!0},p(s,o){const a={};!i&&o&2&&(i=!0,a.currentFormPayload=s[1],J(()=>i=!1)),e.$set(a)},i(s){t||(w(e.$$.fragment,s),t=!0)},o(s){$(e.$$.fragment,s),t=!1},d(s){A(e,s)}}}function Oo(r){let e,i,t;function n(s){r[17](s)}let l={};return r[1]!==void 0&&(l.currentFormPayload=r[1]),e=new kl({props:l}),j.push(()=>O(e,"currentFormPayload",n)),{c(){x(e.$$.fragment)},l(s){F(e.$$.fragment,s)},m(s,o){C(e,s,o),t=!0},p(s,o){const a={};!i&&o&2&&(i=!0,a.currentFormPayload=s[1],J(()=>i=!1)),e.$set(a)},i(s){t||(w(e.$$.fragment,s),t=!0)},o(s){$(e.$$.fragment,s),t=!1},d(s){A(e,s)}}}function zo(r){let e,i;return e=new li({props:{onDownloadClick:r[7],$$slots:{default:[Uo]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&536870912&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Ro(r){let e,i;return e=new li({props:{onDownloadClick:r[7],$$slots:{default:[Go]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&536870912&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Jo(r){let e,i;return e=new $o({props:{onDownloadClick:r[7],isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function qo(r){let e,i,t,n;const l=[Qo,Ko],s=[];function o(a,f){return a[2]==="edit-asset-details"||a[2]==="assets-summary"||a[2]==="add-assets"?0:1}return e=o(r),i=s[e]=l[e](r),{c(){i.c(),t=H()},l(a){i.l(a),t=H()},m(a,f){s[e].m(a,f),S(a,t,f),n=!0},p(a,f){let c=e;e=o(a),e===c?s[e].p(a,f):(q(),$(s[c],1,1,()=>{s[c]=null}),Y(),i=s[e],i?i.p(a,f):(i=s[e]=l[e](a),i.c()),w(i,1),i.m(t.parentNode,t))},i(a){n||(w(i),n=!0)},o(a){$(i),n=!1},d(a){a&&g(t),s[e].d(a)}}}function Yo(r){let e,i;return e=new li({props:{onDownloadClick:r[7],$$slots:{default:[ef]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&536870912&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Uo(r){let e,i;return e=new xr({props:{isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Go(r){let e,i;return e=new Cr({props:{isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Ko(r){let e,i;return e=new li({props:{onDownloadClick:r[7],$$slots:{default:[Xo]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&536870912&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Qo(r){let e,i;return e=new li({props:{onDownloadClick:r[7],$$slots:{default:[Zo]},$$scope:{ctx:r}}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p(t,n){const l={};n&536870912&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Xo(r){let e,i;return e=new Lr({props:{isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)}
1,m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function Zo(r){let e,i;return e=new Vr({props:{isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function ef(r){let e,i;return e=new Ar({props:{isPreview:!0}}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},p:Me,i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function tf(r){let e,i;return e=new Br({}),{c(){x(e.$$.fragment)},l(t){F(e.$$.fragment,t)},m(t,n){C(e,t,n),i=!0},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){$(e.$$.fragment,t),i=!1},d(t){A(e,t)}}}function nf(r){var _t,Mt;let e,i="",t,n,l,s,o,a,f,c,u,m,p,_,d,b="Legal Overview",y,h,k,L=(_t=r[4])!=null&&_t.name?`${(Mt=r[4])==null?void 0:Mt.name}'s`:"",E,W,M,N,z,R,Z,G,X,ne,Q,ye,ue,de,Ve,xe,Ue,je,tt,rt,it;function lt(K){r[14](K)}let dt={};r[0]!==void 0&&(dt.currentPreviewStep=r[0]),s=new _l({props:dt}),j.push(()=>O(s,"currentPreviewStep",lt)),p=new Le({props:{kind:"go-back"}}),z=new ht({props:{type:"tertiary",onClick:r[16],name:"preview-will",text:"Preview Will",classes:"px-6"}});const fe=[Oo,jo,Wo,Mo,Ho],se=[];function at(K,re){return K[0]==="personal-details"?0:K[0]==="assets-liabilities"?1:K[0]==="beneficiaries"?2:K[0]==="asset-distribution"?3:K[0]==="executors"?4:-1}~(X=at(r))&&(ne=se[X]=fe[X](r));const Ge=[Yo,qo,Jo,Ro,zo],we=[];function nt(K,re){return K[0]==="personal-details"?0:K[0]==="assets-liabilities"?1:K[0]==="beneficiaries"?2:K[0]==="asset-distribution"?3:K[0]==="executors"?4:-1}return~(ue=nt(r))&&(de=we[ue]=Ge[ue](r)),Ue=new Po({props:{close:r[21],$$slots:{default:[tf]},$$scope:{ctx:r}}}),{c(){e=P("script"),e.innerHTML=i,n=V(),l=P("div"),x(s.$$.fragment),a=V(),f=P("div"),c=P("div"),u=P("div"),m=P("div"),x(p.$$.fragment),_=V(),d=P("p"),d.textContent=b,y=V(),h=P("p"),k=pe("Editing "),E=pe(L),W=pe(`
2					Will`),M=V(),N=P("div"),x(z.$$.fragment),R=V(),Z=P("div"),G=P("div"),ne&&ne.c(),Q=V(),ye=P("div"),de&&de.c(),Ve=V(),xe=P("div"),x(Ue.$$.fragment),this.h()},l(K){const re=$r("svelte-vxcpdd",document.head);e=D(re,"SCRIPT",{src:!0,"data-svelte-h":!0}),te(e)!=="svelte-13cgkan"&&(e.innerHTML=i),re.forEach(g),n=T(K),l=D(K,"DIV",{class:!0});var $e=B(l);F(s.$$.fragment,$e),a=T($e),f=D($e,"DIV",{class:!0});var Se=B(f);c=D(Se,"DIV",{class:!0});var Ie=B(c);u=D(Ie,"DIV",{class:!0});var ke=B(u);m=D(ke,"DIV",{class:!0});var pt=B(m);F(p.$$.fragment,pt),_=T(pt),d=D(pt,"P",{class:!0,"data-svelte-h":!0}),te(d)!=="svelte-pfk2v3"&&(d.textContent=b),pt.forEach(g),y=T(ke),h=D(ke,"P",{class:!0});var et=B(h);k=be(et,"Editing "),E=be(et,L),W=be(et,`
3					Will`),et.forEach(g),ke.forEach(g),M=T(Ie),N=D(Ie,"DIV",{class:!0});var Ke=B(N);F(z.$$.fragment,Ke),Ke.forEach(g),Ie.forEach(g),R=T(Se),Z=D(Se,"DIV",{class:!0});var ot=B(Z);G=D(ot,"DIV",{class:!0});var ft=B(G);ne&&ne.l(ft),ft.forEach(g),Q=T(ot),ye=D(ot,"DIV",{class:!0});var st=B(ye);de&&de.l(st),st.forEach(g),ot.forEach(g),Se.forEach(g),$e.forEach(g),Ve=T(K),xe=D(K,"DIV",{class:!0});var gt=B(xe);F(Ue.$$.fragment,gt),gt.forEach(g),this.h()},h(){Ir(e.src,t="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.js")||I(e,"src",t),I(d,"class","text-xs font-semibold text-dark_grey_text leading-3"),I(m,"class","inline-flex gap-x-1 cursor-pointer items-start"),I(h,"class","font-bold text-lg leading-6 text-dark_grey_text"),I(u,"class","flex flex-auto flex-col gap-y-4"),I(N,"class","flex justify-end items-end gap-x-5"),I(c,"class","flex w-full justify-between items-end pt-7 pb-5 border-b border-white"),I(G,"class","block h-full overflow-hidden mr-[24px] col-span-1"),I(ye,"class","col-span-1"),I(Z,"class","grid grid-cols-2 w-full overflow-hidden pt-[40px] pb-[68px]"),I(f,"class","hidden md:flex flex-auto flex-col h-[100dvh] overflow-hidden pl-16 pr-9 w-max"),I(l,"class","flex flex-col md:flex-row w-full min-h-[100dvh] md:min-h-[calc(100dvh-76px)] md:overflow-y-hidden"),I(xe,"class",je=r[3]?"block":"hidden")},m(K,re){v(document.head,e),S(K,n,re),S(K,l,re),C(s,l,null),v(l,a),v(l,f),v(f,c),v(c,u),v(u,m),C(p,m,null),v(m,_),v(m,d),v(u,y),v(u,h),v(h,k),v(h,E),v(h,W),v(c,M),v(c,N),C(z,N,null),v(f,R),v(f,Z),v(Z,G),~X&&se[X].m(G,null),v(Z,Q),v(Z,ye),~ue&&we[ue].m(ye,null),S(K,Ve,re),S(K,xe,re),C(Ue,xe,null),tt=!0,rt||(it=ge(m,"click",Je(r[15])),rt=!0)},p(K,[re]){var et,Ke;const $e={};!o&&re&1&&(o=!0,$e.currentPreviewStep=K[0],J(()=>o=!1)),s.$set($e),(!tt||re&16)&&L!==(L=(et=K[4])!=null&&et.name?`${(Ke=K[4])==null?void 0:Ke.name}'s`:"")&&Be(E,L);const Se={};re&8&&(Se.onClick=K[16]),z.$set(Se);let Ie=X;X=at(K),X===Ie?~X&&se[X].p(K,re):(ne&&(q(),$(se[Ie],1,1,()=>{se[Ie]=null}),Y()),~X?(ne=se[X],ne?ne.p(K,re):(ne=se[X]=fe[X](K),ne.c()),w(ne,1),ne.m(G,null)):ne=null);let ke=ue;ue=nt(K),ue===ke?~ue&&we[ue].p(K,re):(de&&(q(),$(we[ke],1,1,()=>{we[ke]=null}),Y()),~ue?(de=we[ue],de?de.p(K,re):(de=we[ue]=Ge[ue](K),de.c()),w(de,1),de.m(ye,null)):de=null);const pt={};re&536870912&&(pt.$$scope={dirty:re,ctx:K}),Ue.$set(pt),(!tt||re&8&&je!==(je=K[3]?"block":"hidden"))&&I(xe,"class",je)},i(K){tt||(w(s.$$.fragment,K),w(p.$$.fragment,K),w(z.$$.fragment,K),w(ne),w(de),w(Ue.$$.fragment,K),tt=!0)},o(K){$(s.$$.fragment,K),$(p.$$.fragment,K),$(z.$$.fragment,K),$(ne),$(de),$(Ue.$$.fragment,K),tt=!1},d(K){K&&(g(n),g(l),g(Ve),g(xe)),g(e),A(s),A(p),A(z),~X&&se[X].d(),~ue&&we[ue].d(),A(Ue),rt=!1,it()}}}function sf(r,e,i){let t,n,l,s,o,a;U(r,xt,Q=>i(4,t=Q)),U(r,Ze,Q=>i(9,n=Q)),U(r,ii,Q=>
3i(10,l=Q)),U(r,He,Q=>i(11,s=Q)),U(r,ei,Q=>i(12,o=Q)),U(r,Et,Q=>i(13,a=Q));let f="personal-details",c={},u="customer-info";const m=()=>{i(0,f="personal-details")};$i(async()=>{await vr(()=>import("../chunks/html2pdf.B2kWTxFi.js").then(Q=>Q.h),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),Sr.generateWill()});const p=Q=>{mi.generateWill(n.url.searchParams,u,c)},_=Q=>{mi.generateWill(n.url.searchParams,u,c)},d=Q=>{mi.generateWill(n.url.searchParams,u,c)},b=Q=>{mi.generateWill(n.url.searchParams,u,c)};let y;const h=Q=>{Q&&i(2,y=Q)},k=()=>{ri("/legal-dashboard/legal_overview")};let L=!1;const E=()=>{i(3,L=!1)};async function W(){const Q=await Er();Q&&saveAs(Q,`will-document-${t.id}.docx`)}function M(Q){f=Q,i(0,f),i(9,n)}const N=()=>k(),z=()=>{i(3,L=!0)};function R(Q){c=Q,i(1,c)}function Z(Q){c=Q,i(1,c)}function G(Q){c=Q,i(1,c)}function X(Q){c=Q,i(1,c)}const ne=()=>{E()};return r.$$.update=()=>{if(r.$$.dirty&513){const Q=n.url.searchParams.get("step");if(Q){i(0,f=Q);try{qr.parse(f),i(0,f),i(9,n)}catch(ye){m(),console.error("will-preview::invalid-step-error ",ye)}}else m()}if(r.$$.dirty&513)switch(f){case"personal-details":i(8,u="customer-info");break;case"assets-liabilities":const Q=n.url.searchParams.get("assets-liabilities-step");Q==="assets-summary"||Q==="edit-asset-details"||Q==="add-assets"?i(8,u="assets"):i(8,u="liabilities");break;case"beneficiaries":i(8,u="beneficiaries");break;case"asset-distribution":i(8,u="asset-distribution");break;case"executors":i(8,u="executors");break;default:i(8,u="customer-info");break}r.$$.dirty&770&&mi.generateWill(n.url.searchParams,u,c),r.$$.dirty&8192&&p(),r.$$.dirty&4096&&_(),r.$$.dirty&2048&&d(),r.$$.dirty&1024&&b(),r.$$.dirty&512&&h(n.url.searchParams.get("assets-liabilities-step"))},[f,c,y,L,t,k,E,W,u,n,l,s,o,a,M,N,z,R,Z,G,X,ne]}class Pf extends ae{constructor(e){super(),oe(this,e,sf,nf,le,{})}}export{Pf as component,If as universal};
4function __vite__mapDeps(indexes) {
5  if (!__vite__mapDeps.viteFileDeps) {
6    __vite__mapDeps.viteFileDeps = ["../chunks/html2pdf.B2kWTxFi.js","../chunks/ioc.DJuwJiaz.js","../chunks/scheduler.BUO0MXo3.js","../chunks/index.C2KUhGDG.js","../chunks/each.DvKsEuuv.js","../chunks/Icon.CbVpWBTV.js","../chunks/showInfo.BnlOLpyA.js","../chunks/modal.Bn0Ybu0X.js","../chunks/index.s6ThxzvO.js","../chunks/index.BAvrQ_cS.js","../assets/ioc.B7QkLQX7.css","../chunks/preload-helper.BQ24v_F8.js"]
7  }
8  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
9}

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.