var e=(e,s,t)=>new Promise((a,l)=>{var i=e=>{try{r(t.next(e))}catch(s){l(s)}},n=e=>{try{r(t.throw(e))}catch(s){l(s)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(i,n);r((t=t.apply(e,s)).next())});import{_ as s}from"./supabase-C8kocL5G.js";import{j as t}from"./radix-ui-CVZWoPyd.js";import{r as a}from"./react-vendor-BmlOtb7g.js";import{F as l,B as i}from"./index-BCSgDlp8.js";import{C as n,b as r,c,a as o}from"./card-BrVzo7bW.js";import{B as m}from"./badge-CHmVsFC8.js";import{I as d}from"./input-DClY5yZE.js";import{S as x}from"./SEO-BGpcOjpb.js";import{A as h}from"./AppSidebar-BQ3UxiE1.js";import{a as u}from"./react-router-DzDVDRUd.js";import{B as p}from"./building-2-xmYyS5DZ.js";import{M as j}from"./map-pin-BNow_pFf.js";import{S as g}from"./search-Dj8gdQAd.js";import{P as f}from"./plus-DTFoGqPI.js";import{C as b}from"./circle-check-big-XRSq9IsA.js";import{E as N}from"./external-link-DuZiTz8-.js";import"./utils-Ceo22G_t.js";import"./use-mobile-onbIdywO.js";import"./CheckoutButton-BXcL0vXQ.js";import"./analytics-CgKQjs6u.js";import"./arrow-right-CcptuZBy.js";import"./wrench-n19foI4n.js";import"./x-DIEzjPMA.js";import"./log-out-DrMwdybL.js";import"./briefcase-Cj6O7NU7.js";import"./circle-plus-C5zM2HoU.js";import"./sparkles-D1jOictl.js";import"./trending-up-DMpQ-MB3.js";import"./book-open-D7nUFbtH.js";import"./settings-BQk8nNSr.js";import"./chevron-right-D_Z5YBDv.js";import"./chevron-left-D5q9zZf8.js";import"./credit-card-CUy9-vWB.js";function v(){const v=u(),[y,w]=a.useState([]),[C,k]=a.useState([]),[S,P]=a.useState([]),[_,L]=a.useState(""),[A,B]=a.useState(""),[M,F]=a.useState(""),[T,E]=a.useState(!0),[R,$]=a.useState(!1),[q,O]=a.useState(1);a.useEffect(()=>{D()},[]);const D=()=>e(this,null,function*(){try{const{getCachedAllData:t}=yield s(()=>e(this,null,function*(){const{getCachedAllData:e}=yield import("./programmaticSeoCache-DX9C344M.js");return{getCachedAllData:e}}),[]),a=yield t();w(a.businessTypes),k(a.cities),P(a.pages.business_plan)}catch(t){console.error("Error fetching cached data:",t);try{const[e,s,t]=yield Promise.all([fetch("/api/programmatic-seo/business-types"),fetch("/api/programmatic-seo/cities"),fetch("/api/programmatic-seo/pages?type=business_plan")]),a=yield e.json(),l=yield s.json(),i=yield t.json();a.success&&w(a.data),l.success&&k(l.data.slice(0,50)),i.success&&P(i.data)}catch(a){console.error("Error with fallback data fetch:",a)}}finally{E(!1)}}),I=S.filter(e=>{const s=e.business_types.name.toLowerCase().includes(_.toLowerCase())||e.cities.city.toLowerCase().includes(_.toLowerCase())||e.title.toLowerCase().includes(_.toLowerCase()),t=!A||e.business_types.category===A,a=!M||`${e.cities.city}, ${e.cities.state}`===M;return s&&t&&a}),z=[...new Set(y.map(e=>e.category))],G=[...new Set(S.map(e=>`${e.cities.city}, ${e.cities.state}`))],V=I.length,Y=Math.ceil(V/50),H=50*(q-1),J=H+50,W=(e=>{const s=[...e];for(let t=s.length-1;t>0;t--){const e=Math.floor(Math.random()*(t+1));[s[t],s[e]]=[s[e],s[t]]}return s})(I).slice(H,J);a.useEffect(()=>{O(1)},[_,A,M]);const K=["Financial projections included","Market analysis included","5-year forecasts included","Risk assessment included","Operations plan included","Marketing strategy included","Executive summary included","Funding guidance included","Legal structure advice included","Growth strategies included"];return T?t.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-slate-600",children:"Loading templates..."})]})}):t.jsxs(t.Fragment,{children:[t.jsx(x,{title:"Free Business Plan Templates by Industry & Location",description:"Get free business plan templates for any industry and location. Complete business plans with financial projections for restaurants, gyms, salons, and more.",keywords:["business plan templates","free business plans","startup business plan","business plan examples","industry business plans","restaurant business plan","gym business plan","salon business plan"],canonical:"/business-plan-templates"}),t.jsxs("div",{className:"flex h-screen",children:[t.jsx(h,{}),t.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-50",children:[t.jsxs("div",{className:"bg-gradient-to-br from-green-500 to-green-600 text-white relative overflow-hidden",children:[t.jsx("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-96 h-96 bg-white/10 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute top-20 right-1/4 w-64 h-64 bg-white/15 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute top-40 left-1/4 w-80 h-80 bg-emerald-300/20 rounded-full blur-3xl"}),t.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-4xl lg:text-5xl font-bold mb-6",children:"Free Business Plan Templates"}),t.jsx("p",{className:"text-xl lg:text-2xl text-green-100 mb-8 max-w-3xl mx-auto",children:"Professional business plan templates with financial projections, market analysis, and strategic guidance for any industry and location."}),t.jsxs("div",{className:"flex flex-wrap justify-center gap-4 mb-8",children:[t.jsxs(m,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[t.jsx(p,{className:"w-4 h-4 mr-2"}),y.length,"+ Industries"]}),t.jsxs(m,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[t.jsx(j,{className:"w-4 h-4 mr-2"}),C.length,"+ Cities"]}),t.jsxs(m,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[t.jsx(l,{className:"w-4 h-4 mr-2"}),S.length," Templates Available"]})]}),t.jsx(i,{size:"lg",className:"bg-white text-green-600 hover:bg-green-50",onClick:()=>v("/questionnaire"),children:"Create Custom Business Plan"})]})})]}),t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[t.jsxs(n,{className:"mb-8",children:[t.jsx(r,{children:t.jsxs(c,{className:"flex items-center",children:[t.jsx(g,{className:"w-5 h-5 mr-2"}),"Find Your Business Plan Template"]})}),t.jsx(o,{children:t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Search Templates"}),t.jsx(d,{placeholder:"Restaurant, Chicago, Hair Salon...",value:_,onChange:e=>L(e.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Filter by Category"}),t.jsxs("select",{className:"w-full px-3 py-2 border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",value:A,onChange:e=>B(e.target.value),children:[t.jsx("option",{value:"",children:"All Categories"}),z.map(e=>t.jsx("option",{value:e,children:e},e))]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Filter by Location"}),t.jsxs("select",{className:"w-full px-3 py-2 border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",value:M,onChange:e=>F(e.target.value),children:[t.jsx("option",{value:"",children:"All Locations"}),G.map(e=>t.jsx("option",{value:e,children:e},e))]})]})]})})]}),t.jsxs("div",{className:"mb-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsxs("h2",{className:"text-3xl font-bold text-slate-900",children:["Available Business Plan Templates (",I.length,")"]}),R&&t.jsxs(m,{variant:"outline",className:"animate-pulse",children:[t.jsx(f,{className:"w-4 h-4 mr-1"}),"Generating..."]})]}),0===I.length?t.jsx(n,{className:"text-center py-12",children:t.jsxs(o,{children:[t.jsx(l,{className:"w-12 h-12 text-slate-400 mx-auto mb-4"}),t.jsx("h3",{className:"text-lg font-medium text-slate-900 mb-2",children:"No templates found"}),t.jsx("p",{className:"text-slate-600 mb-4",children:"Try adjusting your search criteria or create a custom business plan."}),t.jsx(i,{onClick:()=>v("/questionnaire"),children:"Create Custom Plan"})]})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:W.map(e=>{var s,a,d;return t.jsxs(n,{className:"hover:shadow-lg transition-shadow",children:[t.jsx(r,{children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs(c,{className:"text-lg leading-tight mb-2",children:[e.business_types.name," in ",e.cities.city]}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(m,{variant:"outline",className:"text-xs",children:e.business_types.category}),t.jsxs(m,{variant:"outline",className:"text-xs",children:[t.jsx(j,{className:"w-3 h-3 mr-1"}),e.cities.state]})]})]}),t.jsx(l,{className:"w-5 h-5 text-green-500 flex-shrink-0"})]})}),t.jsx(o,{children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-slate-600",children:"Startup Cost:"}),t.jsxs("span",{className:"font-medium",children:["$",(null==(s=e.business_types.avg_startup_cost)?void 0:s.toLocaleString())||"N/A"]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-slate-600",children:"Avg. Revenue:"}),t.jsxs("span",{className:"font-medium",children:["$",(null==(a=e.business_types.avg_revenue)?void 0:a.toLocaleString())||"N/A"]})]}),t.jsxs("div",{className:"flex justify-between text-sm",children:[t.jsx("span",{className:"text-slate-600",children:"Population:"}),t.jsx("span",{className:"font-medium",children:null==(d=e.cities.population)?void 0:d.toLocaleString()})]}),t.jsxs("div",{className:"pt-3 border-t",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[t.jsx(b,{className:"w-4 h-4 text-green-500"}),t.jsx("span",{className:"text-sm text-slate-600",children:K[Math.floor(Math.random()*K.length)]})]}),t.jsxs(i,{className:"w-full",size:"sm",onClick:()=>v(`/${e.slug}`),children:["View Business Plan",t.jsx(N,{className:"w-4 h-4 ml-2"})]})]})]})})]},e.id)})}),Y>1&&t.jsxs("div",{className:"flex justify-center items-center mt-8 space-x-4",children:[t.jsx(i,{variant:"outline",disabled:1===q,onClick:()=>O(q-1),children:"Previous"}),t.jsx("div",{className:"flex items-center space-x-2",children:Array.from({length:Math.min(5,Y)},(e,s)=>{let a;return a=Y<=5||q<=3?s+1:q>=Y-2?Y-4+s:q-2+s,t.jsx(i,{variant:q===a?"default":"outline",size:"sm",onClick:()=>O(a),children:a},a)})}),t.jsx(i,{variant:"outline",disabled:q===Y,onClick:()=>O(q+1),children:"Next"})]}),t.jsxs("div",{className:"text-center mt-4 text-sm text-slate-600",children:["Showing ",H+1,"-",Math.min(J,V)," of ",V," templates"]})]}),t.jsxs(n,{className:"mb-8",children:[t.jsx(r,{children:t.jsx(c,{className:"text-2xl",children:"What's Included in Our Business Plan Templates?"})}),t.jsx(o,{children:t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(b,{className:"w-6 h-6 text-green-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Executive Summary"}),t.jsx("p",{className:"text-slate-600",children:"Compelling overview of your business concept and opportunity."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(b,{className:"w-6 h-6 text-green-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Financial Projections"}),t.jsx("p",{className:"text-slate-600",children:"5-year financial forecasts with revenue and expense models."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(b,{className:"w-6 h-6 text-green-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Market Analysis"}),t.jsx("p",{className:"text-slate-600",children:"Local market research and competitive landscape analysis."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(b,{className:"w-6 h-6 text-green-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Operations Plan"}),t.jsx("p",{className:"text-slate-600",children:"Detailed operational procedures and resource requirements."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(b,{className:"w-6 h-6 text-green-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Marketing Strategy"}),t.jsx("p",{className:"text-slate-600",children:"Customer acquisition and retention strategies."})]})]}),t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx(b,{className:"w-6 h-6 text-green-500 mt-1"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-slate-900",children:"Risk Analysis"}),t.jsx("p",{className:"text-slate-600",children:"Risk assessment and mitigation strategies."})]})]})]})})]}),t.jsx(n,{className:"bg-gradient-to-r from-green-500 to-green-600 text-white",children:t.jsxs(o,{className:"p-8 text-center",children:[t.jsx("h3",{className:"text-2xl font-bold mb-4",children:"Ready to Start Your Business?"}),t.jsx("p",{className:"text-lg text-green-100 mb-6",children:"Get a comprehensive business plan tailored to your specific industry, location, and goals."}),t.jsx(i,{size:"lg",className:"bg-white text-green-600 hover:bg-green-50",onClick:()=>v("/questionnaire"),children:"Create Custom Business Plan"})]})})]})]})]})]})}export{v as default};