1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2761],{65991:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/kibo-catalog-count",function(){return o(68063)}])},68063:(e,t,o)=>{"use strict";o.r(t),o.d(t,{__N_SSP:()=>s,default:()=>a});var i=o(6029),n=o(55729);let r=[{key:"live",label:"Live on storefront",hint:"Reachable on the site today"},{key:"hidden",label:"Hidden from storefront",hint:"Flagged hide_from_storefront"},{key:"total",label:"Total indexed",hint:"Everything in the search index"}],l={container:{fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',maxWidth:"800px",margin:"0 auto",padding:"40px 20px",backgroundColor:"#fff",minHeight:"100vh"},header:{marginBottom:"30px",borderBottom:"2px solid #e0e0e0",paddingBottom:"20px"},title:{fontSize:"28px",fontWeight:"bold",margin:"0 0 8px 0",color:"#1a1a1a"},subtitle:{fontSize:"14px",color:"#666",margin:"0"},tiles:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",marginBottom:"20px"},tile:{backgroundColor:"#fff",border:"1px solid #e0e0e0",borderRadius:"8px",padding:"20px",boxShadow:"0 2px 4px rgba(0,0,0,0.05)"},tileLabel:{fontSize:"14px",fontWeight:"500",color:"#333",margin:"0 0 8px 0"},tileValue:{fontSize:"32px",fontWeight:"bold",color:"#0066cc",margin:"0"},tileHint:{fontSize:"12px",color:"#888",margin:"6px 0 0 0"},button:{padding:"8px 20px",fontSize:"14px",fontWeight:"500",border:"none",borderRadius:"4px",backgroundColor:"#0066cc",color:"#fff",cursor:"pointer"},loading:{fontSize:"14px",color:"#666",padding:"20px 0"},error:{background:"#fee",border:"1px solid #c00",borderRadius:"4px",padding:"15px",color:"#800",marginBottom:"20px"},footnote:{fontSize:"12px",color:"#666",lineHeight:"1.6",marginTop:"30px",paddingTop:"20px",borderTop:"1px solid #e0e0e0"}};var s=!0;let a=e=>{let{data:t,error:o,sessionToken:s}=e,[a,d]=(0,n.useState)(null),[c,p]=(0,n.useState)(!0),[h,x]=(0,n.useState)(null),u=!o&&!!(null==t?void 0:t.verified),g=(0,n.useCallback)(async()=>{p(!0),x(null);try{let e=await fetch("/api/admin/catalog/count",{headers:{"x-kibo-session-token":s||""}}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to fetch catalog counts");d(t)}catch(e){d(null),x(e instanceof Error?e.message:"Failed to fetch catalog counts")}finally{p(!1)}},[s]);return((0,n.useEffect)(()=>{u&&g()},[u,g]),u)?(0,i.jsxs)("div",{style:l.container,children:[(0,i.jsxs)("div",{style:l.header,children:[(0,i.jsx)("h1",{style:l.title,children:"Live Product Count"}),(0,i.jsx)("p",{style:l.subtitle,children:"How much of the catalog is actually reachable on the site"})]}),h&&(0,i.jsxs)("div",{style:l.error,children:[(0,i.jsx)("strong",{children:"Error:"})," ",h]}),c&&(0,i.jsx)("div",{style:l.loading,children:"Loading catalog counts..."}),a&&!c&&(0,i.jsx)("div",{style:l.tiles,children:r.map(e=>(0,i.jsxs)("div",{style:l.tile,children:[(0,i.jsx)("p",{style:l.tileLabel,children:e.label}),(0,i.jsx)("p",{style:l.tileValue,children:a[e.key].toLocaleString()}),(0,i.jsx)("p",{style:l.tileHint,children:e.hint})]},e.key))}),(0,i.jsx)("button",{type:"button",onClick:g,disabled:c,style:{...l.button,opacity:c?.6:1},children:c?"Loading...":"Refresh"}),(0,i.jsxs)("p",{style:l.footnote,children:["Counts products in the storefront search index. âLiveâ excludes anything flagged"," ",(0,i.jsx)("code",{children:"tenant~hide_from_storefront"})," â the same filter the site's category pages, search, and products sitemap use. These are ",(0,i.jsx)("strong",{children:"product"})," counts, not variation-SKU counts: the storefront index holds one entry per product, so this number will not match the SKU total shown in Kibo's catalog."]})]}):(0,i.jsx)("div",{style:{padding:"20px",fontFamily:"system-ui, -apple-system, sans-serif"},children:(0,i.jsxs)("div",{style:l.error,children:[(0,i.jsx)("strong",{children:"Access Denied:"})," ",o||"Unauthorized access"]})})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=65991)),_N_E=e.O()}]);
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.