import{d as L,r as y,j as T,cv as E,e as D}from"./index-BOwCLZTK.js";import{A as H}from"./index-2RIoVPos.js";/**
 * @license lucide-react v0.559.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],x=L("house",M),N=400;function P({value:a,format:o,prefix:t,className:n,style:s}){const[e,u]=y.useState("waiting");if(y.useEffect(()=>{const l=setTimeout(()=>u("mounted"),N);return()=>clearTimeout(l)},[]),y.useEffect(()=>{if(e==="mounted"){const l=requestAnimationFrame(()=>u("animating"));return()=>cancelAnimationFrame(l)}},[e]),e==="waiting"){const l=0 .toLocaleString(void 0,o);return T.jsxs("span",{className:n,style:s,children:[t,l]})}return T.jsx(H,{className:n,style:s,format:o,prefix:t,transition:E.numberReveal,children:e==="animating"?a:0})}function O(a,o){let t;try{t=a()}catch{return}return{getItem:s=>{var e;const u=m=>m===null?null:JSON.parse(m,void 0),l=(e=t.getItem(s))!=null?e:null;return l instanceof Promise?l.then(u):u(l)},setItem:(s,e)=>t.setItem(s,JSON.stringify(e,void 0)),removeItem:s=>t.removeItem(s)}}const A=a=>o=>{try{const t=a(o);return t instanceof Promise?t:{then(n){return A(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return A(n)(t)}}}},R=(a,o)=>(t,n,s)=>{let e={storage:O(()=>localStorage),partialize:r=>r,version:0,merge:(r,h)=>({...h,...r}),...o},u=!1;const l=new Set,m=new Set;let d=e.storage;if(!d)return a((...r)=>{console.warn(`[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`),t(...r)},n,s);const p=()=>{const r=e.partialize({...n()});return d.setItem(e.name,{state:r,version:e.version})},F=s.setState;s.setState=(r,h)=>(F(r,h),p());const v=a((...r)=>(t(...r),p()),n,s);s.getInitialState=()=>v;let g;const I=()=>{var r,h;if(!d)return;u=!1,l.forEach(i=>{var c;return i((c=n())!=null?c:v)});const f=((h=e.onRehydrateStorage)==null?void 0:h.call(e,(r=n())!=null?r:v))||void 0;return A(d.getItem.bind(d))(e.name).then(i=>{if(i)if(typeof i.version=="number"&&i.version!==e.version){if(e.migrate){const c=e.migrate(i.state,i.version);return c instanceof Promise?c.then(S=>[!0,S]):[!0,c]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,i.state];return[!1,void 0]}).then(i=>{var c;const[S,b]=i;if(g=e.merge(b,(c=n())!=null?c:v),t(g,!0),S)return p()}).then(()=>{f==null||f(g,void 0),g=n(),u=!0,m.forEach(i=>i(g))}).catch(i=>{f==null||f(void 0,i)})};return s.persist={setOptions:r=>{e={...e,...r},r.storage&&(d=r.storage)},clearStorage:()=>{d==null||d.removeItem(e.name)},getOptions:()=>e,rehydrate:()=>I(),hasHydrated:()=>u,onHydrate:r=>(l.add(r),()=>{l.delete(r)}),onFinishHydration:r=>(m.add(r),()=>{m.delete(r)})},e.skipHydration||I(),g||v},z=R,w=["repeater","companion","room_server","hubs","direct"],_={showTopology:!1,showNeighborLines:!0,show3DTerrain:!1,showMinCut:!1,showLinkQuality:!1,nodeFilters:[...w]},C=D()(z(a=>({viewState:null,setViewState:o=>a({viewState:o,lastSavedAt:Date.now()}),toggles:_,setToggle:(o,t)=>a(n=>({toggles:{...n.toggles,[o]:t},lastSavedAt:Date.now()})),setToggles:o=>a(t=>({toggles:{...t.toggles,...o},lastSavedAt:Date.now()})),hasAnalyzed:!1,setHasAnalyzed:o=>a({hasAnalyzed:o,lastSavedAt:Date.now()}),modalMapOpen:!1,setModalMapOpen:o=>a({modalMapOpen:o}),lastSavedAt:null,reset:()=>a({viewState:null,toggles:_,hasAnalyzed:!1,lastSavedAt:null})}),{name:"pymc-map-view",version:2,migrate:(a,o)=>{const t=a,n=t.toggles??{};if(o===0){const s=n.nodeFilter;let e=[...w];return s==="hubs"?e=["hubs"]:s==="direct"&&(e=["direct"]),{...t,toggles:{...n,nodeFilters:e,nodeFilter:void 0}}}if(o===1){const s=n.nodeFilters,e=s&&s.length>0?s:[...w];return{...t,toggles:{...n,nodeFilters:e}}}return a},partialize:a=>({viewState:a.viewState,toggles:a.toggles,hasAnalyzed:a.hasAnalyzed,lastSavedAt:a.lastSavedAt})}));export{w as A,P as D,x as H,O as c,z as p,C as u};
