import{as as i}from"./index-BmjEiQ1N.js";import{P as r}from"./taxstore-_HmhNaxB.js";const s="children:v1",a={hasChildren:!1,children:[],moreThanFiveChildrenNote:""},o=i("childrenstore",{state:()=>{try{let e=r.getItem(s);if(typeof e=="string")try{e=JSON.parse(e)}catch{e=null}if(e&&typeof e=="object")return{data:{...e}}}catch{}return{data:{...a}}},actions:{persist(){try{const e={hasChildren:!!this.data.hasChildren,children:Array.isArray(this.data.children)?this.data.children.map(t=>({firstName:t.firstName,lastName:t.lastName,birthDate:t.birthDate,sameHousehold:t.sameHousehold,alimentiVersati:t.alimentiVersati??!1,school:t.school,hasCareCost:t.hasCareCost??!1,careCosts:t.careCosts,address:t.address??null})):[],moreThanFiveChildrenNote:this.data.moreThanFiveChildrenNote||""};r.set(s,e)}catch(e){console.error("children.store: persist error",e)}},getChildren(){return this.data},setChildren(e){this.data={...this.data,...e},this.persist()},replaceChildren(e){this.data=e,this.persist()},resetChildren(){this.data={...a},this.persist()}}});export{o as u};
