1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{$ as t,J as n,P as r,U as i}from"./uiFramework-CmzQ-hQv.js";import{h as a,p as o,u as s}from"./dist-mmH4yOc3.js";import{a as c,i as l,n as u,r as d,t as f}from"./useNavbarBreakpoint-DY8lZZnb.js";import{t as p}from"./DefaultTemplate-CtnUFuV1.js";import{t as m}from"./ChatDrawer-CubdiPvy.js";var h=e(t(),1),g=r();function _({pageNavData:e,previewData:t}){function n(t){window.parent.postMessage({data:t||e?.find(e=>e.path===`/`),type:`previewPageNavigate`},`*`)}let r=t.websiteLevelSections?.nodes?.find(e=>e.__typename===`NavbarSection`),i={...t,navbarSectionFields:r,pages:e.filter(e=>!e.templateType||!s.includes(e.templateType))},{fullViewNavigation:a}=f(e||[],i);return r?a?(0,g.jsx)(c,{...i,fullViewNavigationMenu:(0,g.jsx)(d,{handleNavigationInPreview:n,pages:i.pages??[]}),handleNavigationInPreview:n}):(0,g.jsx)(c,{...i,hamburgerNavigationMenu:({onMenuClose:e})=>(0,g.jsx)(l,{handleNavigationInPreview:n,onMenuClose:e,pages:i.pages??[]}),handleNavigationInPreview:n}):null}function v(e){let{hostname:t}=new URL(e);return t.split(`.`).slice(-2).join(`.`)}var y=({host:e})=>{let[t,n]=(0,h.useState)(void 0),{pageNavData:r,setPageNavData:i}=a();if((0,h.useEffect)(()=>{window.parent.postMessage({type:`handshake`},`*`)},[]),(0,h.useEffect)(()=>{let t=({data:t,origin:r})=>{if(v(r)===v(e)&&(t.type===`update`&&(n(t.data.pageData),i(t.data.allPagesNavigationData)),t.type===`focus`)){let e=document.querySelector(`[data-section-id="${t.sectionId}"]`);e&&window.scroll({behavior:`smooth`,top:e.getBoundingClientRect().top+window.scrollY-97})}};return window.addEventListener(`message`,t),()=>{window.removeEventListener(`message`,t)}},[e,i]),!t)return`Loading...`;function s(e){return{businessName:e.businessName,logoUrl:e.logoUrl,phone:e.phone,sections:e.pages?.nodes[0]?.sections?.nodes??[],title:e.pages?.nodes[0]?.title??``}}function c(e){window.parent.postMessage({data:{sectionId:e},type:`sectionClick`},`*`)}let l={primaryColor:t?.branding?.primaryColor||null,secondaryColor:t?.branding?.secondaryColor||null};return(0,g.jsx)(`div`,{className:`preview`,ref:e=>{e&&e.querySelectorAll(`a`).forEach(e=>{e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)})},children:(0,g.jsxs)(u,{brandingOptions:l,children:[(0,g.jsx)(_,{pageNavData:r??[],previewData:t}),(0,g.jsx)(p,{onSectionClick:c,pageData:s(t)}),t.chatEnabled&&(0,g.jsx)(o,{children:(0,g.jsx)(m,{businessName:t.businessName,websiteName:t.name})})]})})},b=n(function(){let{apiHost:e}=i();return(0,g.jsx)(y,{host:e})});export{b as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.