const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-.bun-TPgXvEwq.js","assets/vendor--V65Sl9C2.css","assets/renderMobileApp-DpYY7X9v.js","assets/index-D9t9eCUC.js","assets/index-BDH6F8f2.css","assets/useAppFontEffects-DEZpweZZ.js","assets/NewWorktreeDialog-6y6rHfOQ.js","assets/mobileLayoutPreference-Dio-WWkI.js","assets/main-D8KFwoUt.js","assets/SessionSwitcherDropdown-DSXsR7zB.js","assets/main-BV3KOtdA.css"])))=>i.map(i=>d[i]);
import{c as w}from"./index-D9t9eCUC.js";import{_ as a}from"./vendor-.bun-TPgXvEwq.js";import{g as p}from"./mobileLayoutPreference-Dio-WWkI.js";function h(t={}){const{immediate:r=!1,onNeedRefresh:n,onOfflineReady:o,onRegistered:s,onRegisteredSW:c,onRegisterError:d}=t;let i,u;const f=async(e=!0)=>{await u};async function m(){if("serviceWorker"in navigator){if(i=await a(async()=>{const{Workbox:e}=await import("./vendor-.bun-TPgXvEwq.js").then(_=>_.ch);return{Workbox:e}},__vite__mapDeps([0,1])).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{d?.(e)}),!i)return;i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||o?.()}),i.register({immediate:r}).then(e=>{c?c("/sw.js",e):s?.(e)}).catch(e=>{d?.(e)})}}return u=m(),f}window.__OPENCHAMBER_RUNTIME_APIS__=w();const v=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches,g=()=>{const r=new URLSearchParams(window.location.search).get("surface");if(r==="mobile")return"mobile";if(r==="desktop")return"desktop";const n=Math.min(window.innerWidth||0,window.screen?.width||window.innerWidth||0),o=navigator.maxTouchPoints||0;return n>0&&n<=760&&(o>0||v())&&p()==="new"?"mobile":"desktop"},l=g();window.__OPENCHAMBER_SURFACE__=l;const S=()=>!(!("serviceWorker"in navigator)||!window.isSecureContext||window.location.protocol!=="http:"&&window.location.protocol!=="https:"||document.prerendering||String(document.visibilityState)==="prerender"),E=t=>{let r=!1;const n=()=>{r||S()&&(r=!0,t())},o=()=>{setTimeout(n,0)};document.readyState==="complete"?o():window.addEventListener("load",o,{once:!0}),(document.prerendering||String(document.visibilityState)==="prerender")&&document.addEventListener("visibilitychange",n,{once:!0})},P=()=>{E(()=>{try{h({onRegisterError(t){console.warn("[PWA] service worker registration skipped:",t)}})}catch(t){console.warn("[PWA] service worker registration skipped:",t)}})};l==="mobile"?a(async()=>{const{renderMobileApp:t}=await import("./renderMobileApp-DpYY7X9v.js");return{renderMobileApp:t}},__vite__mapDeps([2,0,1,3,4,5,6,7])).then(({renderMobileApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??w())}):a(()=>import("./main-D8KFwoUt.js").then(t=>t.m),__vite__mapDeps([8,0,1,3,4,5,6,7,9,10]));P();
