const scriptTemplate = '"use strict";const l=location.protocol==="https:"?"wss:":"ws:",c=__LIVE_PREVIEW_CLIENT_PORT__,i=c==null?location.host:`${location.hostname}:${c}`,r=__LIVE_PREVIEW_CLIENT_BASE__,_=l+"//"+i+r;n("connecting...");a();let o=!1,s=!1;function a(){const e=new WebSocket(_);e.addEventListener("open",()=>{if(s){location.reload();return}s=!0,o=!0,n("connected.")}),e.addEventListener("message",t=>{try{JSON.parse(t.data)?.type==="page-reload"&&location.reload()}catch{}}),e.addEventListener("close",t=>{!t.wasClean&&o&&n("server connection lost. reconnecting..."),setTimeout(()=>a(),1e3),o=!1})}function n(e){console.log(`[vite-live-preview] ${e}`)}';
export {
  scriptTemplate as default
};
//# sourceMappingURL=client.data.js.map
