1import{j as e,A as c,ci as j,r as w,fd as v,bG as M,L as k,aZ as N,G as C,fe as D,ff as P,fg as I}from"./index-CVUXbWDK.js";import{S}from"./Slices-BedWY-dV.js";import{g as E,a as L}from"./bannerCarouselLinkUtils-Dh9XFnai.js";import"./ProductSpotlight-Bn2K4F0J.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new n.Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="1c3ef6be-bd20-44ed-8554-ffe38acf7a96",n._sentryDebugIdIdentifier="sentry-dbid-1c3ef6be-bd20-44ed-8554-ffe38acf7a96")}catch{}})();(function(){var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n._sentryModuleMetadata=n._sentryModuleMetadata||{},(function(){var r,a=new n.Error().stack,d=n._sentryModuleMetadata[a]||{},s={"_sentryBundlerPluginAppKey:mm-sentry-boysenberry":!0},o={};for(r in d)d.hasOwnProperty(r)&&(o[r]=d[r]);for(r in s)s.hasOwnProperty(r)&&(o[r]=s[r]);n._sentryModuleMetadata[a]=o})()})();function O(n){const r=[];return n==null||n.forEach(a=>{var d;(d=a.items)==null||d.forEach(s=>{const o=E(s);o!=null&&o.startsWith("#")&&!s.linkedCarouselData&&r.push({id:s.id,bannerName:s.name??s.bannerName??"Unnamed banner",slug:o.substring(1).trim()})})}),r}function _({carousels:n}){const r=O(n);return r.length?e.jsx(c,{variant:"error",children:e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-5 font-grotesk-bold",children:"Banner Link Issue(s) Found!"}),e.jsx("ul",{className:"list-disc pl-15",children:r.map(a=>e.jsxs("li",{children:[a.bannerName," is not properly linked to #",a.slug]},`${a.id}-${a.slug}`))})]})}):null}function q(){var f,g,b,m,h;const{storefrontConfigurationID:n}=j(),[r,a]=w.useState(!1),{handleCloseProductsModal:d,productsModalData:s,productsModalOpen:o}=v(),{data:t,isLoading:u}=M({queryKey:["storefront-config-preview",n],queryFn:async()=>{var p,x,y;const i=await I({storefrontConfigurationID:n});return(p=i==null?void 0:i.data)!=null&&p.carousels&&L({carousels:i.data.carousels,logContext:{configID:(y=(x=i.data)==null?void 0:x.debug)==null?void 0:y.id}}),i}});if(u)return e.jsx("div",{className:"flex h-screen items-center justify-center bg-white",children:e.jsx(k,{})});const l=((f=t==null?void 0:t.data)==null?void 0:f.carousels)||[];if(!l||l.length===0){const i=t.msg!=="Success"?t.msg:t.data.msg;return e.jsx("div",{className:"flex h-screen items-center justify-center bg-white",children:e.jsx(c,{variant:"error",children:i||"Error loading storefront configuration"})})}return e.jsx("main",{className:"min-h-[calc(100vh-80px) mt-70 bg-white md:mt-30",children:e.jsxs("div",{className:"mt-10 overflow-x-hidden bg-malt px-10 md:bg-white md:pt-80 lg:mx-auto lg:max-w-(--breakpoint-3xl) if:bg-oat md:if:bg-white",children:[e.jsxs("div",{className:"z-10 mb-10 space-y-10 md:mb-20",children:[e.jsxs(c,{children:["You are previewing the ",e.jsx("span",{className:"font-grotesk-bold",children:(b=(g=t==null?void 0:t.data)==null?void 0:g.debug)==null?void 0:b.name})," ","storefront configuration."," ",e.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":"Storefront configuration details",children:e.jsx(N,{className:"inline-block size-15"})})]}),e.jsx(_,{carousels:l}),r&&e.jsx(C,{headline:e.jsx("h2",{className:"text-body-lg font-grotesk-bold",children:"Storefront configuration details"}),open:r,onClose:()=>a(!1),children:e.jsx("div",{className:"p-10",children:e.jsx("pre",{className:"text-body-xs rounded-lg bg-[#fafafa] p-10",children:JSON.stringify((m=t==null?void 0:t.data)==null?void 0:m.debug,null,2)})})})]}),e.jsxs(D,{children:[e.jsx(S,{data:{slices:l,isLoading:u,debug:(h=t==null?void 0:t.data)==null?void 0:h.debug}}),o&&s&&e.jsx(P,{data:s.data,deepLinkProductID:s.deepLinkProductID,isOpen:o,onClose:d,dsSourceOverride:s.dsSourceOverride,productCardMetaData:s.productCardMetaData||{}})]})]})})}export{q as Component}; 2//# sourceMappingURL=StorefrontConfigPreview-BtkMRH0L.js.map
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.