import{Ir as e}from"./i18n-CsN8OUP9.js";import{_ as t}from"./registry-CwOJ4xqK.js";var n=`hermes.desktop.paneStates.v1`;function r(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.open!=`boolean`)return!1;let n=t.widthOverride===void 0||typeof t.widthOverride==`number`&&Number.isFinite(t.widthOverride),r=t.heightOverride===void 0||typeof t.heightOverride==`number`&&Number.isFinite(t.heightOverride);return n&&r}function i(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(n);if(e){let t=JSON.parse(e);if(t&&typeof t==`object`){let e={};for(let[n,i]of Object.entries(t))r(i)&&(e[n]={open:i.open,widthOverride:i.widthOverride,heightOverride:i.heightOverride});return e}}}catch{}return{}}function a(e){if(!(typeof window>`u`))try{window.localStorage.setItem(n,JSON.stringify(e))}catch{}}var o=e(i());o.subscribe(a);function s(e,n,r){let i=e.get(n);return i||(i=t(o,e=>r(e[n])),e.set(n,i)),i}var c=new Map,l=new Map,u=new Map,d=e=>s(c,e,e=>e),f=e=>s(l,e,e=>e?.widthOverride),p=e=>s(u,e,e=>e?.heightOverride);function m(e,t){let n=o.get();n[e]===void 0&&o.set({...n,[e]:{open:t.open,widthOverride:t.widthOverride}})}function h(e,t){let n=o.get(),r=n[e];r?.open!==t&&o.set({...n,[e]:{...r,open:t}})}function g(e){let t=o.get(),n=t[e];o.set({...t,[e]:{...n,open:!(n?.open??!1)}})}function _(e,t){let n=o.get(),r=n[e]??{open:!1};r.widthOverride!==t&&o.set({...n,[e]:{...r,widthOverride:t}})}function v(e,t){let n=o.get(),r=n[e]??{open:!1};r.heightOverride!==t&&o.set({...n,[e]:{...r,heightOverride:t}})}function y(){let e=o.get(),t=!1,n={};for(let[r,i]of Object.entries(e))i.widthOverride!==void 0||i.heightOverride!==void 0?(t=!0,n[r]={open:i.open}):n[r]=i;t&&o.set(n)}export{y as a,h as c,f as i,_ as l,d as n,m as o,o as r,v as s,p as t,g as u};