import{as as n}from"./index-Dga5rwnp.js";import{P as e}from"./LocalStorage-BQmANGBd.js";const s="taxstore:v1",i={prevPreparedByUs:!1,prevDeclaration:{comments:"",attachments:[]},firstName:"",lastName:"",birthDate:"",address:{street:"",cap:"",city:"",country:{code:"",name:""},canton:""}},r={alimentiVersati:!1,alimentiCommenti:{comments:"",attachments:[]},maritalStatus:"",spouseFirstName:"",spouseLastName:"",spouseBirthDate:"",spouseDeadDate:"",spouseTaxNumber:"",spouseAddress:{street:"",cap:"",city:"",country:{code:"",name:""},canton:""},marriageDate:"",separated:!1,spouseAlimentiVersati:!1},c=n("taxstore",{state:()=>{try{const t=e.getItem(s);if(t&&typeof t=="object"){const a=t;if(Array.isArray(a.items))return{items:a.items}}}catch{}return{items:[{key:"taxpayer",data:{...i}},{key:"marital",data:{...r}}]}},actions:{persist(){try{e.set(s,{items:this.items})}catch{}},_findTaxpayer(){return this.items.find(t=>t.key==="taxpayer")},_findMarital(){return this.items.find(t=>t.key==="marital")},getTaxpayer(){return this._findTaxpayer()?.data},setTaxpayer(t){const a=this._findTaxpayer();a&&(a.data={...a.data,...t}),this.persist()},replaceTaxpayer(t){const a=this._findTaxpayer();a&&(a.data=t),this.persist()},resetTaxpayer(){const t=this._findTaxpayer();t&&(t.data={...i}),this.persist()},getMarital(){return this._findMarital()?.data},setMarital(t){const a=this._findMarital();a&&(a.data={...a.data,...t}),this.persist()},replaceMarital(t){const a=this._findMarital();a&&(a.data=t),this.persist()},resetMarital(){const t=this._findMarital();t&&(t.data={...r}),this.persist()}}});export{c as u};
