import{r as e}from"./appConfig-CDeG57c-.js";import{r as t}from"./norm-f7iXVy-b.js";var n=e=>`offer_lens_user_profile_v1_${String(e||`public`).trim()||`public`}`,r=async e=>new Promise(t=>{try{chrome.storage?.local?.get?.(e,n=>t({...e,...n}))}catch{t(e)}}),i=async e=>new Promise(t=>{try{chrome.storage?.local?.set?.(e,()=>t())}catch{t()}}),a=async e=>{let i=n(e),a=(await r({[i]:null}))?.[i],o=a&&typeof a==`object`?a:{};return{nickname:t(o.nickname),note:t(o.note),updatedAt:Number(o.updatedAt||0)||0}},o=async(r,o)=>{let s=await a(r),c={...s,...o,nickname:t(o?.nickname??s.nickname),note:t(o?.note??s.note),updatedAt:Date.now()};return await i({[n(r)]:c}),e({type:`USER_PROFILE_UPDATED`}),c};export{o as n,a as t};