1import{j as e,n as ue,u as T,H as P,o as D,p as H,Q as Y,l as pe,q as ge,r as fe,B as be}from"./index-DrnNUvE6.js";import{r as y,h as je,j as ye,k as we,i as ve,L as S}from"./react-vendor-DyyNuaBf.js";import{C as M}from"./ColumnLines-BHKTIVF4.js";import{S as ke}from"./SEO-BEsTXI-r.js";import{A as I}from"./AutoLinkedText-BC0d3wjn.js";import"./sanity-vendor-B0Ef7JkI.js";import"./firebase-vendor-CgMjXGMT.js";function A(t){return t._type==="span"&&"text"in t&&typeof t.text=="string"&&(t.marks===void 0||Array.isArray(t.marks)&&t.marks.every(r=>typeof r=="string"))}function ee(t){return typeof t._type=="string"&&t._type[0]!=="@"&&(!("markDefs"in t)||!t.markDefs||Array.isArray(t.markDefs)&&t.markDefs.every(r=>typeof r._key=="string"))&&"children"in t&&Array.isArray(t.children)&&t.children.every(r=>typeof r=="object"&&"_type"in r)}function te(t){return ee(t)&&"listItem"in t&&typeof t.listItem=="string"&&(t.level===void 0||typeof t.level=="number")}function se(t){return t._type==="@list"}function re(t){return t._type==="@span"}function le(t){return t._type==="@text"}const J=["strong","em","code","underline","strike-through"];function Ne(t,r,l){if(!A(t)||!t.marks||!t.marks.length)return[];let i=t.marks.slice(),s={};return i.forEach(n=>{s[n]=1;for(let d=r+1;d<l.length;d++){let h=l[d];if(h&&A(h)&&Array.isArray(h.marks)&&h.marks.indexOf(n)!==-1)s[n]++;else break}}),i.sort((n,d)=>Ie(s,n,d))}function Ie(t,r,l){let i=t[r],s=t[l];if(i!==s)return s-i;let n=J.indexOf(r),d=J.indexOf(l);return n===d?r.localeCompare(l):n-d}function _e(t){var d;let{children:r}=t,l=t.markDefs??[];if(!r||!r.length)return[];let i=r.map(Ne),s={_type:"@span",children:[],markType:"<unknown>"},n=[s];for(let h=0;h<r.length;h++){let f=r[h];if(!f)continue;let v=i[h]||[],k=1;if(n.length>1)for(;k<n.length;k++){let a=((d=n[k])==null?void 0:d.markKey)||"",c=v.indexOf(a);if(c===-1)break;v.splice(c,1)}n=n.slice(0,k);let o=n[n.length-1];if(o){for(let a of v){let c=l==null?void 0:l.find(x=>x._key===a),u={_type:"@span",_key:f._key,children:[],markDef:c,markType:c?c._type:a,markKey:a};o.children.push(u),n.push(u),o=u}if(A(f)){let a=f.text.split(` 2`);for(let c=a.length;c-- >1;)a.splice(c,0,` 3`);o.children=o.children.concat(a.map(c=>({_type:"@text",text:c})))}else o.children=o.children.concat(f)}}return s.children}function Te(t,r){let l=[],i;for(let s=0;s<t.length;s++){let n=t[s];if(n){if(!te(n)){l.push(n),i=void 0;continue}if(!i){i=B(n,s,r),l.push(i);continue}if(Se(n,i)){i.children.push(n);continue}if((n.level||1)>i.level){let d=B(n,s,r);if(r==="html"){let h=i.children[i.children.length-1],f={...h,children:[...h.children,d]};i.children[i.children.length-1]=f}else i.children.push(d);i=d;continue}if((n.level||1)<i.level){let d=l[l.length-1],h=d&&R(d,n);if(h){i=h,i.children.push(n);continue}i=B(n,s,r),l.push(i);continue}if(n.listItem!==i.listItem){let d=l[l.length-1],h=d&&R(d,{level:n.level||1});if(h&&h.listItem===n.listItem){i=h,i.children.push(n);continue}else{i=B(n,s,r),l.push(i);continue}}console.warn("Unknown state encountered for block",n),l.push(n)}}return l}function Se(t,r){return(t.level||1)===r.level&&t.listItem===r.listItem}function B(t,r,l){return{_type:"@list",_key:`${t._key||`${r}`}-parent`,mode:l,level:t.level||1,listItem:t.listItem,children:[t]}}function R(t,r){let l=r.level||1,i=r.listItem||"normal",s=typeof r.listItem=="string";if(se(t)&&(t.level||1)===l&&s&&(t.listItem||"normal")===i)return t;if(!("children"in t))return;let n=t.children[t.children.length-1];return n&&!A(n)?R(n,r):void 0}function ne(t){let r="";return t.children.forEach(l=>{le(l)?r+=l.text:re(l)&&(r+=ne(l))}),r}const Ce="html",$e={number:({children:t})=>e.jsx("ol",{children:t}),bullet:({children:t})=>e.jsx("ul",{children:t})},Le=({children:t})=>e.jsx("li",{children:t}),Ue=({children:t,value:r})=>e.jsx("a",{href:r==null?void 0:r.href,children:t}),Be={textDecoration:"underline"},Ae={em:({children:t})=>e.jsx("em",{children:t}),strong:({children:t})=>e.jsx("strong",{children:t}),code:({children:t})=>e.jsx("code",{children:t}),underline:({children:t})=>e.jsx("span",{style:Be,children:t}),"strike-through":({children:t})=>e.jsx("del",{children:t}),link:Ue},$=(t,r)=>`[@portabletext/react] Unknown ${t}, specify a component for it in the \`components.${r}\` prop`,ie=t=>$(`block type "${t}"`,"types"),ze=t=>$(`mark type "${t}"`,"marks"),Pe=t=>$(`block style "${t}"`,"block"),De=t=>$(`list style "${t}"`,"list"),He=t=>$(`list item style "${t}"`,"listItem");function Me(t){console.warn(t)}const Re={display:"none"},X={types:{},block:{normal:({children:t})=>e.jsx("p",{children:t}),blockquote:({children:t})=>e.jsx("blockquote",{children:t}),h1:({children:t})=>e.jsx("h1",{children:t}),h2:({children:t})=>e.jsx("h2",{children:t}),h3:({children:t})=>e.jsx("h3",{children:t}),h4:({children:t})=>e.jsx("h4",{children:t}),h5:({children:t})=>e.jsx("h5",{children:t}),h6:({children:t})=>e.jsx("h6",{children:t})},marks:Ae,list:$e,listItem:Le,hardBreak:()=>e.jsx("br",{}),unknownType:({value:t,isInline:r})=>{let l=ie(t._type);return e.jsx(r?"span":"div",{style:Re,children:l})},unknownMark:({markType:t,children:r})=>e.jsx("span",{className:`unknown__pt__mark__${t}`,children:r}),unknownList:({children:t})=>e.jsx("ul",{children:t}),unknownListItem:({children:t})=>e.jsx("li",{children:t}),unknownBlockStyle:({children:t})=>e.jsx("p",{children:t})};function Oe(t,r){let{block:l,list:i,listItem:s,marks:n,types:d,...h}=r;return{...t,block:C(t,r,"block"),list:C(t,r,"list"),listItem:C(t,r,"listItem"),marks:C(t,r,"marks"),types:C(t,r,"types"),...h}}function C(t,r,l){let i=r[l],s=t[l];return typeof i=="function"||i&&typeof s=="function"?i:i?{...s,...i}:s}function Fe({value:t,components:r,listNestingMode:l,onMissingComponent:i=Me}){let s=i||Ve,n=Te(Array.isArray(t)?t:[t],l||Ce),d=y.useMemo(()=>r?Oe(X,r):X,[r]),h=y.useMemo(()=>Ee(d,s),[d,s]);return e.jsx(e.Fragment,{children:n.map((f,v)=>h({node:f,index:v,isInline:!1,renderNode:h}))})}const Ee=(t,r)=>{function l(o){let{node:a,index:c,isInline:u}=o,x=a._key||`node-${c}`;return se(a)?n(a,c,x):te(a)?s(a,c,x):re(a)?d(a,c,x):i(a)?k(a,c,x,u):ee(a)?h(a,c,x,u):le(a)?f(a,x):v(a,c,x,u)}function i(o){return o._type in t.types}function s(o,a,c){let u=Z({node:o,index:a,isInline:!1,renderNode:l}
3),x=t.listItem,g=(typeof x=="function"?x:x[o.listItem])||t.unknownListItem;if(g===t.unknownListItem){let b=o.listItem||"bullet";r(He(b),{type:b,nodeType:"listItemStyle"})}let p=u.children;if(o.style&&o.style!=="normal"){let{listItem:b,..._}=o;p=l({node:_,index:a,isInline:!1})}return e.jsx(g,{value:o,index:a,isInline:!1,renderNode:l,children:p},c)}function n(o,a,c){let u=o.children.map((p,b)=>l({node:p._key?p:{...p,_key:`li-${a}-${b}`},index:b,isInline:!1})),x=t.list,g=(typeof x=="function"?x:x[o.listItem])||t.unknownList;if(g===t.unknownList){let p=o.listItem||"bullet";r(De(p),{nodeType:"listStyle",type:p})}return e.jsx(g,{value:o,index:a,isInline:!1,renderNode:l,children:u},c)}function d(o,a,c){let{markDef:u,markType:x,markKey:g}=o,p=t.marks[x]||t.unknownMark,b=o.children.map((_,w)=>l({node:_,index:w,isInline:!0}));return p===t.unknownMark&&r(ze(x),{nodeType:"mark",type:x}),e.jsx(p,{text:ne(o),value:u,markType:x,markKey:g,renderNode:l,children:b},c)}function h(o,a,c,u){let{_key:x,...g}=Z({node:o,index:a,isInline:u,renderNode:l}),p=g.node.style||"normal",b=(typeof t.block=="function"?t.block:t.block[p])||t.unknownBlockStyle;return b===t.unknownBlockStyle&&r(Pe(p),{nodeType:"blockStyle",type:p}),e.jsx(b,{...g,value:g.node,renderNode:l},c)}function f(o,a){if(o.text===` 4`){let c=t.hardBreak;return c?e.jsx(c,{},a):` 5`}return o.text}function v(o,a,c,u){let x={value:o,isInline:u,index:a,renderNode:l};r(ie(o._type),{nodeType:"block",type:o._type});let g=t.unknownType;return e.jsx(g,{...x},c)}function k(o,a,c,u){let x={value:o,isInline:u,index:a,renderNode:l},g=t.types[o._type];return g?e.jsx(g,{...x},c):null}return l};function Z(t){let{node:r,index:l,isInline:i,renderNode:s}=t,n=_e(r).map((d,h)=>s({node:d,isInline:!0,index:h,renderNode:s}));return{_key:r._key||`block-${l}`,children:n,index:l,isInline:i,node:r}}function Ve(){}function ae(t){const r=t.match(/youtube\.com\/watch\?.*v=([^&]+)/),l=t.match(/youtu\.be\/([^?&]+)/),i=t.match(/youtube\.com\/embed\/([^?&]+)/),s=(r==null?void 0:r[1])||(l==null?void 0:l[1])||(i==null?void 0:i[1]);if(s)return{provider:"youtube",id:s,embedUrl:`https://www.youtube-nocookie.com/embed/${s}?autoplay=1&rel=0`};const n=t.match(/vimeo\.com\/(?:channels\/[^/]+\/)?(\d+)/);return n?{provider:"vimeo",id:n[1],embedUrl:`https://player.vimeo.com/video/${n[1]}?autoplay=1`}:null}const oe=({url:t,thumbnailUrl:r,title:l="Video"})=>{const[i,s]=y.useState(!1),n=ae(t),d=y.useCallback(()=>{s(!0)},[]);if(!n)return null;const h=n.provider==="youtube"?`https://i.ytimg.com/vi/${n.id}/maxresdefault.jpg`:void 0,f=r||h;return e.jsx("div",{className:"relative w-full aspect-video rounded-xl overflow-hidden bg-srs-black group",children:i?e.jsx("iframe",{src:n.embedUrl,title:l,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,className:"absolute inset-0 w-full h-full",loading:"lazy"}):e.jsxs("button",{type:"button",onClick:d,className:"absolute inset-0 w-full h-full cursor-pointer focus:outline-none focus-visible:ring-4 focus-visible:ring-srs-orange focus-visible:ring-offset-2","aria-label":`Play video: ${l}`,children:[f&&e.jsx("img",{src:f,alt:`Thumbnail for ${l}`,className:"absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-black/30 transition-colors group-hover:bg-black/40"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"flex items-center justify-center w-16 h-16 lg:w-20 lg:h-20 rounded-full bg-srs-orange text-white shadow-lg transition-transform duration-300 group-hover:scale-110",children:e.jsx(ue,{className:"w-8 h-8 lg:w-10 lg:h-10 ml-1"})})}),e.jsx("span",{className:"absolute bottom-4 left-4 text-white text-sm font-medium bg-black/60 px-3 py-1 rounded-lg backdrop-blur-sm",children:n.provider==="youtube"?"YouTube":"Vimeo"})]})})},We={block:{h2:({children:t})=>e.jsx("h2",{className:"font-heading text-2xl lg:text-3xl text-srs-black mt-10 mb-4",children:e.jsx(I,{children:t})}),h3:({children:t})=>e.jsx("h3",{className:"font-heading text-xl lg:text-2xl text-srs-black mt-8 mb-3",children:e.jsx(I,{children:t})}),h4:({children:t})=>e.jsx("h4",{className:"font-heading text-lg lg:text-xl text-srs-black mt-6 mb-2",children:e.jsx(I,{children:t})}),normal:({children:t})=>e.jsx("p",{className:"text-gray-700 leading-relaxed mb-4",children:e.jsx(I,{children:t})}),blockquote:({children:t})=>e.jsx("blockquote",{className:"border-l-4 border-srs-orange pl-6 py-2 my-6 text-gray-600 italic bg-srs-cream/50 rounded-r-lg pr-4",children:e.jsx(I,{children:t})})},list:{bullet:({children:t})=>
5e.jsx("ul",{className:"list-disc list-outside ml-6 mb-4 space-y-2 text-gray-700",children:t}),number:({children:t})=>e.jsx("ol",{className:"list-decimal list-outside ml-6 mb-4 space-y-2 text-gray-700",children:t})},listItem:{bullet:({children:t})=>e.jsx("li",{className:"pl-2",children:e.jsx(I,{children:t})}),number:({children:t})=>e.jsx("li",{className:"pl-2",children:e.jsx(I,{children:t})})},marks:{strong:({children:t})=>e.jsx("strong",{className:"font-semibold",children:t}),em:({children:t})=>e.jsx("em",{children:t}),underline:({children:t})=>e.jsx("span",{className:"underline",children:t}),code:({children:t})=>e.jsx("code",{className:"bg-gray-100 text-sm px-1.5 py-0.5 rounded font-mono",children:t}),link:({children:t,value:r})=>e.jsx("a",{href:r==null?void 0:r.href,target:r!=null&&r.blank?"_blank":void 0,rel:r!=null&&r.blank?"noopener noreferrer":void 0,className:"text-srs-orange underline hover:text-orange-600 transition-colors",children:t})},types:{image:({value:t})=>t!=null&&t.asset?e.jsxs("figure",{className:"my-8",children:[e.jsx("img",{src:T(t).width(1200).url(),alt:t.alt||"",className:"w-full rounded-lg",loading:"lazy"}),t.caption&&e.jsx("figcaption",{className:"text-sm text-gray-500 text-center mt-2",children:t.caption})]}):null,videoEmbed:({value:t})=>t!=null&&t.url?e.jsxs("figure",{className:"my-8",children:[e.jsx(oe,{url:t.url,title:t.caption||"Embedded video"}),t.caption&&e.jsx("figcaption",{className:"text-sm text-gray-500 text-center mt-2",children:t.caption})]}):null,callToAction:({value:t})=>e.jsx("div",{className:"my-8 p-6 bg-srs-cream rounded-xl text-center",children:e.jsx(be,{as:"a",href:t.link,variant:t.style||"primary",showArrow:!0,children:t.text})})}};function qe(t){if(!t)return 0;const l=t.filter(i=>i._type==="block").map(i=>{var s;return((s=i.children)==null?void 0:s.map(n=>n.text).join(""))||""}).join(" ").split(/\s+/).length;return Math.ceil(l/200)}const et=()=>{var E,V,W,q,G,K,Q;const{postSlug:t}=je(),[r]=ye(),l=r.get("draft")==="true",i=we(),[s,n]=y.useState(null),[d,h]=y.useState([]),[f,v]=y.useState(!0),[k,o]=y.useState(!1),[a,c]=y.useState(!1),[u,x]=y.useState(!1),[g,p]=y.useState(null);y.useEffect(()=>{async function m(){var N;if(t)try{let j;if(l){const U=await fetch(`/api/draft-post?slug=${encodeURIComponent(t)}`);j=U.ok?await U.json():null}else j=await ge(t);if(!j){o(!0);return}if(n(j),!l&&(((N=j.categories)==null?void 0:N.length)??0)>0){const U=j.categories.map(xe=>xe._id),me=await fe(j._id,U,3);h(me||[])}}catch(j){console.error("Error fetching post:",j),o(!0)}finally{v(!1)}}m()},[t,l]);const b=m=>new Date(m).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});if(f)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block w-8 h-8 border-4 border-srs-orange border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"text-gray-600 mt-4",children:"Loading article..."})]})});if(k||!s)return e.jsx(ve,{to:"/blog",replace:!0});const _=qe(s.body||[]),w=s.mainImage?T(s.mainImage).width(1600).height(900).url():"/images/solar-panels-on-house-2026-01-09-01-13-36-utc.webp",L="https://sixriverssolar.com",ce=`${L}/blog/${s.slug}`,de={"@context":"https://schema.org","@type":"BlogPosting",headline:s.title,description:s.excerpt||"",image:w.startsWith("http")?w:`${L}${w}`,datePublished:s.publishedAt,url:ce,...s.author&&{author:{"@type":"Person",name:s.author.name}},publisher:{"@type":"Organization",name:"Six Rivers Solar",logo:{"@type":"ImageObject",url:`${L}/images/six-rivers-solar.webp`}}},O=s.videoUrl?ae(s.videoUrl):null,z=s.videoThumbnail?T(s.videoThumbnail).width(1280).height(720).url():w,F=O?{"@context":"https://schema.org","@type":"VideoObject",name:s.videoTitle||s.title,description:s.videoDescription||s.excerpt||"",thumbnailUrl:z.startsWith("http")?z:`${L}${z}`,uploadDate:s.publishedAt,contentUrl:s.videoUrl,embedUrl:O.embedUrl,...s.author&&{author:{"@type":"Person",name:s.author.name}}}:null,he=[...F?[F]:[]];return e.jsxs(e.Fragment,{children:[e.jsx(ke,{title:l?`[DRAFT] ${((E=s.seo)==null?void 0:E.metaTitle)||s.title}
5`:((V=s.seo)==null?void 0:V.metaTitle)||s.title,description:((W=s.seo)==null?void 0:W.metaDescription)||s.excerpt||"",keywords:((q=s.categories)==null?void 0:q.map(m=>m.title))||[],canonicalUrl:`/blog/${s.slug}`,ogImage:w,ogType:"article",noIndex:l,structuredData:l?void 0:de,additionalStructuredData:l?void 0:he}),e.jsxs("section",{className:"lg:hidden -mt-20",children:[e.jsxs("div",{className:"relative min-h-[50vh] flex flex-col justify-end",style:{backgroundImage:`url(${w})`,backgroundSize:"cover",backgroundPosition:"center"},children:[e.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.5) 70%, rgba(0,0,0,0.85) 90%, rgb(0,0,0) 100%)"}}),e.jsxs("div",{className:"container-stripe relative z-10 pt-28 pb-4 min-h-[50vh] flex flex-col justify-end",children:[e.jsxs("nav",{className:"flex items-center gap-2 text-sm text-gray-400 mb-2","aria-label":"Breadcrumb",children:[e.jsx(S,{to:"/blog",className:"hover:text-white transition-colors",children:"Blog"}),e.jsx(P,{className:"w-4 h-4"}),e.jsx("span",{className:"text-white line-clamp-1",children:s.title})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(G=s.categories)==null?void 0:G.map(m=>e.jsx("span",{className:"text-xs font-medium bg-white/20 text-white px-2 py-0.5 rounded",children:m.title},m._id))}),e.jsx("h1",{className:"heading-lg text-white",children:s.title})]})]}),e.jsx("div",{className:"bg-srs-black pt-2 pb-6",children:e.jsx("div",{className:"container-stripe",children:e.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"w-4 h-4"}),b(s.publishedAt)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(H,{className:"w-4 h-4"}),_," min read"]})]})})})]}),e.jsxs("section",{className:"hidden lg:block relative pt-40 pb-20 bg-srs-black -mt-24",children:[e.jsxs("div",{className:"absolute inset-0 z-0",children:[e.jsx("img",{src:w,alt:s.title,className:"w-full h-full object-cover opacity-40"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black via-black/80 to-transparent"})]}),e.jsx(M,{variant:"dark"}),e.jsxs("div",{className:"container-stripe relative z-10",children:[e.jsxs("nav",{className:"flex items-center gap-2 text-sm text-gray-400 mb-6","aria-label":"Breadcrumb",children:[e.jsx(S,{to:"/blog",className:"hover:text-white transition-colors",children:"Blog"}),e.jsx(P,{className:"w-4 h-4"}),e.jsx("span",{className:"text-white",children:s.title})]}),e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:(K=s.categories)==null?void 0:K.map(m=>e.jsx("span",{className:"text-xs font-medium bg-white/20 text-white px-2 py-1 rounded",children:m.title},m._id))}),e.jsx("h1",{className:"heading-xl text-white mb-4",children:s.title}),s.excerpt&&e.jsx(I,{children:e.jsx("p",{className:"text-lg text-gray-300 mb-6",children:s.excerpt})}),e.jsxs("div",{className:"flex items-center gap-6 text-gray-400",children:[s.author&&e.jsxs("div",{className:"flex items-center gap-3",children:[s.author.image&&e.jsx("img",{src:T(s.author.image).width(48).height(48).url(),alt:s.author.name,className:"w-12 h-12 rounded-full object-cover"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-white font-medium block",children:s.author.name}),s.author.role&&e.jsx("span",{className:"text-sm",children:s.author.role})]})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"w-4 h-4"}),b(s.publishedAt)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(H,{className:"w-4 h-4"}),_," min read"]})]})]})]})]}),e.jsxs("section",{className:"relative section-padding bg-white",children:[e.jsx(M,{}),e.jsx("div",{className:"container-stripe relative z-10",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 lg:gap-0 max-w-[1220px]",children:[e.jsxs("div",{className:"lg:w-3/4 lg:pl-6 lg:pr-12",children:[s.videoUrl&&e.jsx("div",{className:"mb-8",children:e.jsx(oe,{url:s.videoUrl,thumbnailUrl:s.videoThumbnail?T(s.videoThumbnail).width(1280).height(720).url():w,title:s.videoTitle||s.title})}),e.jsx("article",{className:"prose-wrapper",children:s.body&&s.body.length>0?e.jsx(Fe,{value:s.body,components:We}):e.jsx("p",{className:"text-gray-600",children:"No content available."})}),s.categories&&s.categories.length>0&&e.jsxs("div",{className:"mt-12 pt-8 border-t border-gray-200 lg:hidden",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-3",children:"Categories"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.categories.map(m=>e.jsx(S,{to:`/blog?category=${m.slug}`,className:"bg-srs-cream text-gray-700 text-sm px-3 py-1.5 rounded-lg hover:bg-srs-orange hover:text-white transition-colors",children:m.title},m._id))})]}),e.jsxs("div",{className:"mt-8 pt-8 border-t border-gray-200 lg:hidden",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-3",children:"Share This Article"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("a",{href:`https://twitter.com/intent/tweet?text=${encodeURIComponent(s.title)}&url=${encodeURIComponent(typeof window<"u"?window.location.href:"")}`,target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 bg-srs-cream rounded-full flex items-center justify-center hover:bg-srs-orange hover:text-white transition-colors","aria-label":"Share on Twitter",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),e.jsx("a",{href:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(typeof window<"u"?window.location.href:"")}`,target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 bg-srs-cream rounded-full flex items-center justify-center hover:bg-srs-orange hover:text-white transition-colors","aria-label":"Share on Facebook",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})}),e.jsx("a",{href:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(typeof window<"u"?window.location.href:"")}&title=${encodeURIComponent(s.title)}`,target:"_blank",rel:"noopener noreferrer",className:"w-10 h-10 bg-srs-cream rounded-full flex items-center justify-center hover:bg-srs-orange hover:text-white transition-colors","aria-label":"Share on LinkedIn",children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})})]})]})]}),e.jsx("aside",{className:"hidden lg:block lg:w-1/4",children:e.jsxs("div",{className:"sticky top-28 space-y-6",children:[s.author&&e.jsxs("div",{className:"bg-srs-cream rounded-xl p-5",children:[e.jsx("h4",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-4",children:"About the Author"}),e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.author.image&&e.jsx("img",{src:T(s.author.image).width(56).height(56).url(),alt:s.author.name,className:"w-14 h-14 roun
5ded-full object-cover"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-heading text-srs-black block",children:s.author.name}),s.author.role&&e.jsx("span",{className:"text-sm text-gray-500",children:s.author.role})]})]}),s.author.bio&&e.jsx("p",{className:"text-sm text-gray-600 line-clamp-3",children:s.author.bio})]}),s.categories&&s.categories.length>0&&e.jsxs("div",{className:"bg-srs-cream rounded-xl p-5",children:[e.jsx("h4",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-4",children:"Categories"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.categories.map(m=>e.jsx(S,{to:`/blog?category=${m.slug}`,className:"bg-white text-gray-700 text-sm px-3 py-1.5 rounded-lg hover:bg-srs-orange hover:text-white transition-colors",children:m.title},m._id))})]}),e.jsxs("div",{className:"bg-srs-cream rounded-xl p-5",children:[e.jsx("h4",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide mb-4",children:"Share Article"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("a",{href:`https://twitter.com/intent/tweet?text=${encodeURIComponent(s.title)}&url=${encodeURIComponent(typeof window<"u"?window.location.href:"")}`,target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 bg-white rounded-full flex items-center justify-center hover:bg-srs-orange hover:text-white transition-colors","aria-label":"Share on Twitter",children:e.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),e.jsx("a",{href:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(typeof window<"u"?window.location.href:"")}`,target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 bg-white rounded-full flex items-center justify-center hover:bg-srs-orange hover:text-white transition-colors","aria-label":"Share on Facebook",children:e.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})}),e.jsx("a",{href:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(typeof window<"u"?window.location.href:"")}&title=${encodeURIComponent(s.title)}`,target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 bg-white rounded-full flex items-center justify-center hover:bg-srs-orange hover:text-white transition-colors","aria-label":"Share on LinkedIn",children:e.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})})]})]}),e.jsxs("div",{className:"bg-srs-black rounded-xl p-5 text-center",children:[e.jsx("h4",{className:"font-heading text-lg text-white mb-2",children:"Ready to Go Solar?"}),e.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Get a free quote for your home or business."}),e.jsx(Y,{variant:"primary",size:"sm",showArrow:!0,className:"w-full justify-center",children:"Get a Free Quote"})]}),e.jsxs("div",{className:"text-sm text-gray-500 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),e.jsxs("span",{children:[_," min read"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),e.jsx("span",{children:b(s.publishedAt)})]})]})]})})]})})]}),d.length>0&&e.jsxs("section",{className:"relative section-padding bg-srs-cream",children:[e.jsx(M,{variant:"cream"}),e.jsxs("div",{className:"container-stripe relative z-10",children:[e.jsx("h2",{className:"heading-md mb-8 border-l-4 border-srs-orange pl-4 highlight-left",children:"Related Articles"}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-8",children:d.map(m=>{var N;return e.jsxs(S,{to:`/blog/${m.slug}`,className:"group bg-white rounded-xl overflow-hidden shadow-card hover:shadow-lg transition-shadow",children:[e.jsx("div",{className:"aspect-video overflow-hidden",children:m.mainImage&&e.jsx("img",{src:T(m.mainImage).width(400).height(225).url(),alt:m.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"})}),e.jsxs("div",{className:"p-5",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:(N=m.categories)==null?void 0:N.slice(0,1).map(j=>e.jsx("span",{className:"text-xs font-medium bg-srs-cream px-2 py-0.5 rounded",children:j.title},j._id))}),e.jsx("h3",{className:"font-heading text-lg mb-2 group-hover:text-srs-orange transition-colors line-clamp-2",children:m.title}),e.jsxs("span",{className:"text-srs-orange font-medium text-sm inline-flex items-center gap-1 group-hover:gap-2 transition-all",children:["Read More",e.jsx(P,{className:"w-4 h-4"})]})]})]},m._id)})})]})]}),e.jsx("section",{className:"section-padding bg-srs-black",children:e.jsxs("div",{className:"container-stripe text-center",children:[e.jsx("h2",{className:"heading-lg text-white mb-4",children:"Ready to Go Solar?"}),e.jsx("p",{className:"text-gray-300 text-base lg:text-lg mb-6 lg:mb-8 max-w-2xl mx-auto",children:"Have questions about solar for your home or business? Our team is ready to help you understand your options and find the perfect solution."}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[e.jsx(Y,{variant:"primary",showArrow:!0,children:"Get a Free Quote"}),e.jsxs(S,{to:"/blog",className:"text-gray-400 hover:text-white transition-colors inline-flex items-center gap-1",children:[e.jsx(pe,{className:"w-4 h-4"}),"Back to Blog"]})]})]})}),l&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sticky bottom-0 z-50 bg-amber-500 text-black py-2.5 px-4 font-medium text-sm shadow-[0_-2px_8px_rgba(0,0,0,0.15)]",children:e.jsx("div",{className:"flex items-center justify-center gap-4",children:(Q=s==null?void 0:s._id)!=null&&Q.startsWith("drafts.")?e.
5jsxs(e.Fragment,{children:[e.jsx("span",{children:"DRAFT PREVIEW â This post has not been published"}),e.jsx("button",{onClick:()=>{p(null),x(!0)},disabled:a,className:"bg-black text-white px-4 py-1.5 rounded-md text-sm font-semibold hover:bg-gray-800 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Approve and Publish"})]}):e.jsx("span",{children:"This post is already published â you are viewing the live version"})})}),u&&e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full mx-4 overflow-hidden",children:[e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{className:"font-heading text-xl text-srs-black mb-2",children:"Publish this post?"}),e.jsxs("p",{className:"text-gray-600 text-sm leading-relaxed",children:["This will make ",e.jsxs("strong",{children:['"',s==null?void 0:s.title,'"']})," live on the website immediately. This action cannot be undone from here."]}),g&&e.jsx("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-700 text-sm rounded-lg px-4 py-3",children:g})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 bg-gray-50 border-t border-gray-100",children:[e.jsx("button",{onClick:()=>x(!1),disabled:a,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-black transition-colors disabled:opacity-50",children:"Cancel"}),e.jsxs("button",{onClick:async()=>{if(t){c(!0),p(null);try{const m=await fetch("/api/publish-post",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t})});if(!m.ok){const N=await m.json().catch(()=>({}));throw new Error(N.error||"Failed to publish")}x(!1),i(`/blog/${t}`)}catch(m){p(m.message),c(!1)}}},disabled:a,className:"bg-srs-orange text-white px-5 py-2 rounded-lg text-sm font-semibold hover:bg-orange-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[a&&e.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a?"Publishing...":"Yes, Publish Now"]})]})]})})]})]})};export{et as default}; 6//# sourceMappingURL=BlogPostPage-CjuhRiF7.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.